Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to ask the user how many A's,B's,C's,D or F's were entered and how to display the correct amount? Project 1 Group 4 X -Homework

image text in transcribedHow to ask the user how many A's,B's,C's,D or F's were entered and how to display the correct amount?

Project 1 Group 4 X -Homework 2-Co x D Microsoft Word x | D 12002734 NAU-ITS-Email x GNU Emacs Man. x e C program Please x https://bblearn.nau.edu content/listContentjsp?course_id-_172981 18content.id-7298600 1 Homework 2 - Control Structures - Letter Grade EE-222 (1191-3278) INTERMEDIATE PROGRAMMING (Spring 2019 M16) 001 Course Content Homework 4 Control Structures - Letter Grades This assignment is the continuation of a program that we started in class last week, 1/31. It exposes you to the application of switch statements and while loops. What to do Links and Resources Write a C program, that continuously accepts characters from the command line, one at a time. The accepted letters are A, B, "C, "D', F' and'q. While the letter 'q' will result in the program to be terminated, any of the other letters will trigger the following output Letter Output A Very Good! B "Good!" C "Okay!" D or F "Doomed" our program keeps prompting for letters and putting out the corresponding responses according to the above table until the letter 'q'is entered, upon which the program wil n ask the user if they want to see total of A's, B's, C's or D and F's. Any non-accepted letter will output some error message of your choice, telling the user what input is ccepted and keep going All of the program's logic will go into the main function. You should convince yourself that you need to have a while loop that keeps accepting input, until 'q is entered and you move to the next part of the code.I want you to find a way to leave the while-loop that does not just return/exit right from within the while loop. Options are to check for a flag in the while loop header, check for the letter to be q' or use break once the letter 'q is detected in the loop In any case, I want you to handle the different cases how to deal with each of the input characters by way of a switch statement. You should handle whether to print out totals using something other than a switch statement. The idea is to utilize a switch statement and some other branching statement within the same program What to submit I ask you to submit the following The source code of your program. A screen shot that demonstrates the Run your program and enter these letters in this order A', '. . "D proper working of your program as fo "F 'G"H' . A A'' A' and 'q. Then select to see how many As were entered Hint In class I discussed that your call to scanf will prompt and wait for you to enter somethinq on the keyboard. You need to understand, however, that entering a character

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago

Question

Use service tiering to manage the customer base and build loyalty.

Answered: 1 week ago