Đã hoàn thành

check c

The following is my assignment which has been done but not working. Please take a look at it and check for errors. Thanks This program will accept command line arguments and test to see that they meet certain specifications. If the command line arguments are invalid, specific messages should be displayed and the program should end execution. If the command line arguments are valid, the program should display the contents of the file specified by the last command line argument. If there are only 2 command line arguments the second one should be interpreted as being the name of the file to be read and displayed. If there are 3 command line arguments the third one should be interpreted as being the name of the file to be read and the second one (if valid) should specify the format of how the file should be displayed. Your program should check to see that the user types at least 2 and no more than three command line arguments. (The first one will be the name of the executable program [url removed, login to view] and you do not need to check that.) If the number of command line arguments is incorrect the program should display a message saying that the command line has too many (or too few) argument and end execution. If there are exactly 2 command line arguments, the program should check to see if the second one is the name of a readable file. If it is a readable file, then the program should display the file. If it is not a readable file, then the program should display a message saying that the file cannot be read, display the second command line argument and end execution.. If there are exactly 3 command line arguments, then the program should check to see that the second one is a minus sign followed by zero or more of the following uppercase letters: C, R, U, L.

## Deliverables

If the second command line argument is not in the correct form, the program should indicate what is wrong (i.e. "Second command line argument should begin with -" or "Invalid option specified in the second command line argument.") and execution should end. If the second command line argument is in the correct form, then the program should check to see that the third command line argument is the name of a readable file. If it is not a readable file, then the program should display a message saying the file cannot be read, display the third command line argument and then end execution. If the second command line argument is in the correct form and the third command line argument is the name of a readable file, the file should be read and displayed in the form indicated by the second command line argument. (See next paragraph) When there are three command line arguments, the codes given in the second command line argument indicate the form in which the file is to be displayed. • L indicates the letters in the file should be displayed in lowercase. (Characters which are not letters should be displayed with no change.) • U indicates the letters in the file should be displayed in uppercase. (Characters which are not letters should be displayed with no change.) • C indicates the lines of the file should be centered on the screen when they are displayed. YOU SHOULD ASSUME THAT NO LINE WILL BE MORE THAN 70 CHARACTERS LONG AND THAT THE SCREEN WIDTH IS 70 CHARACTERS. • R indicates the lines of the file should be right justified on the screen when they are displayed. YOU SHOULD ASSUME THAT NO LINE WILL BE MORE THAN 70 CHARACTERS LONG AND THAT THE SCREEN WIDTH IS 70 CHARACTERS. If neither C or R is indicated, the program should assume the lines in the file are displayed beginning in column 1 on the screen. If neither L or U is indicated, the program should assume that no changes should be made to the case of letters in the file before displaying them. In the event that the second command line argument contains conflicting codes, the later one(s) encountered should override earlier ones. For example: -LRUC should indicate uppercase and centered. You may assume that the first character in each line is a nonwhitespace character and that the last character in each line is a newline character preceded by a nonwhitespace character. You simply need to read a line as a string and display that string left-justfified, right-justified or centered and, if U or L are specified, in the correct case. You will want to use the strlen function to determine how to center the line. The toupper and tolower functions may be used to convert a letter to upper or lower case. Those functions are designed to a single character and NOT FOR A STRING OF CHARACTERS. (Hint: You can use a for loop to convert each character in the line.) I will try to send you an example of the output in a day or two.

## Platform

windows xp

Kĩ năng: Lập trình C, Kĩ thuật, MySQL, PHP, Kiến trúc phần mềm, Kiểm tra phần mềm

Xem nhiều hơn: what is r programming, what is in c programming, what is c programming used for, what is c# programming, what is c programming, what is a string in programming, what is an argument in programming, what is a loop in programming, types of programming errors, two lines meet, string in c programming, string c programming, programming loop, programming center, loop programming, i will check this out, is incorrect, how to check a php program, for loop in c programming, for loop c programming

Về Bên Thuê:
( 14 nhận xét ) United States

ID dự án: #2926023

Được trao cho:

michaeldweber

See private message.

$5 USD trong 14 ngày
(35 Đánh Giá)
4.6

24 freelancer đang chào giá trung bình $7 cho công việc này

ExpertFromInd

See private message.

$8.5 USD trong 14 ngày
(48 Nhận xét)
5.4
ingeniadesign

See private message.

$8.5 USD trong 14 ngày
(53 Nhận xét)
5.1
bashirbilal

See private message.

$8.5 USD trong 14 ngày
(15 Nhận xét)
4.7
mihaido

See private message.

$8.5 USD trong 14 ngày
(29 Nhận xét)
4.7
vijaitasaxena

See private message.

$8.5 USD trong 14 ngày
(22 Nhận xét)
4.6
vw477251vw

See private message.

$5.95 USD trong 14 ngày
(39 Nhận xét)
4.4
szaszalexmcpd

See private message.

$6.8 USD trong 14 ngày
(55 Nhận xét)
4.4
teamvw

See private message.

$8.5 USD trong 14 ngày
(36 Nhận xét)
3.8
lubnavw

See private message.

$8.5 USD trong 14 ngày
(10 Nhận xét)
3.8
srinivasangara

See private message.

$5.95 USD trong 14 ngày
(9 Nhận xét)
3.7
barreiro04

See private message.

$5.1 USD trong 14 ngày
(22 Nhận xét)
3.7
ovidiucn

See private message.

$8.5 USD trong 14 ngày
(4 Nhận xét)
2.7
mattjvw

See private message.

$8.5 USD trong 14 ngày
(5 Nhận xét)
2.7
tekguyvw

See private message.

$5.1 USD trong 14 ngày
(10 Nhận xét)
2.5
leonardszigeti

See private message.

$3.4 USD trong 14 ngày
(5 Nhận xét)
1.7
binarysoftwarevw

See private message.

$6.8 USD trong 14 ngày
(5 Nhận xét)
1.5
xtremecodersvw

See private message.

$8.5 USD trong 14 ngày
(1 Nhận xét)
0.0
billycvw

See private message.

$8.5 USD trong 14 ngày
(1 Nhận xét)
0.0
vw755938vw

See private message.

$8.5 USD trong 14 ngày
(0 Nhận xét)
0.0
dnoest

See private message.

$4.25 USD trong 14 ngày
(2 Nhận xét)
0.0