C++ 4 questions

Anonymous
timer Asked: Dec 17th, 2017
account_balance_wallet $15

Question description

Hello , i have 4 questions in c++

i want it by tomorrow so i can practice on it ,thanks

COSC175 – MOCK FINAL EXAM 1. Write a complete program to input a series of test grades from a file named test.txt and report the number of student grades, the number of AS, BS, CS, DS, and FS, the percent below average (DS and FS) and the percent above average (AS and BS). For the file test.txt as follows: Section-001 A C F F D B B C C C A Section-005 C F F D B F C C C A C Output should be: 33 student grades A: 5 B: 7 C: 12 D: 4 Above average: 36.36% Below average: 27.27% C C B B C A B B A D D F: 5 2. Write a complete program to input a series of currency types and amounts from the keyboard (‘D’ for US Dollars or ‘P’ for Mexican Pesos). The input loop should be in main( ) and continue until the sentinel code ‘Q’ is entered to quit. The program should also have a single function named ‘converter’ that receives two parameters (currency type and amount) and prints the original type and amount and the value in the other currency. Entering ‘Q’ value should NOT generate any output. If any code other than D, P or Q is entered, an “Illegal currency type” message should display One US Dollar equals 13.11 Mexican Pesos. Example traces: Enter currency type (D for US Dollars, P for Mexican Pesos, or Q to quit): Enter an amount: 4.55 $4.55 in US Dollars equals 59.65 Mexican Pesos D Enter currency type (D for US Dollars, P for Mexican Pesos, or Q to quit): Enter an amount: 1000 1000 Mexican Pesos equals $76.28 in US Dollars P Enter currency type (D for US Dollars, P for Mexican Pesos, or Q to quit): Illegal currency type Enter currency type (D for US Dollars, P for Mexican Pesos, or Q to quit): M Q 3. Write a complete program that receives a single phone number from the keyboard as a string and then passes it to a filter function (by reference). The function should ERASE all non-numeric characters from the parameter string. As a result, the original string variable should now contain numeric-only characters. If the number of digits in the filtered phone number is not 7 or 10, an error message should print. If the number of digits is 7, the number should print in the form: xxx-xxxx If the number of digits is 10, the number should print in the form: (xxx) xxx-xxxx 3 sample traces: Enter a phone number: (717) 774-4464 Enter a phone number: 774-4464 717.774.4464 774 4464 Enter a phone number: 4464 Not a valid phone number 4. (Arrays, Searching and Sorting) Write a complete program that receives a series of student records from the keyboard and stores them in three parallel arrays named studentID and courseNumber and grade. All arrays are to be 100 elements. The studentID array is to be of type int and the courseNumber and grade arrays are to be of type string. The program should prompt for the number of records to be entered and then receive user input on how many records are to be entered. That value should be used in an input loop to receive the series of records and store them in the parallel arrays. Add a function to printout all records stored in the array. Only print records that were input from the keyboard. Much of the arrays will be unused. Add another function to search the arrays using a specific student ID and display the student’s ID, course number, and grade wherever found, OR the message “ doesn’t exist in array” Add code in main to print all records and prompt a user to enter a student ID and search for it in the arrays. Test both possible outcomes. Sample trace: Enter Enter Enter Enter Enter Enter Enter the number of records record 1 (student ID, record 2 (student ID, record 3 (student ID, record 4 (student ID, record 5 (student ID, record 6 (student ID, to be input: 6 Course number and Course number and Course number and Course number and Course number and Course number and grade): grade): grade): grade): grade): grade): 12 15 22 12 15 12 COSC175 COSC175 COSC175 ENG317 ENG317 PSYC101 A B C A A A Enter a student ID for a record search: 12 12 COSC175 A 12 ENG317 A 12 PSYC101 A Note: If a search had been made for 17, the message “17 doesn’t exist in array” would have been displayed.

Tutor Answer

LESTER_PRO
School: UIUC

...

flag Report DMCA
Review

Anonymous
Outstanding Job!!!!

Similar Questions
Hot Questions
Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors