1. Engineering
  2. Computer Science
  3. can you use c basic to write this simple program...

Question: can you use c basic to write this simple program...

Question details

This program demonstrates the use of characters and strings PLACE YOUR NAME HERE #include iostream» #include <string> using nanespace std; Definition of constants const string FAVORITESODAD. Dolittle; I use double quotes for strings const char BESTRATINGA; /I use single quotes for characters int main() char rating; string favoriteSnack; most preferred snack int numberOfPeople; the number of people in the survey int topChoiceTotal; I the number of people who prefer the top choice 2nd highest product rating / Fill in the code to do the following: / Assign the value of crackers to favoriteSnack // Assign a grade of B to rating Assign the number 250 to the numberOfPeople / Assign the number 148 to the topChoiceTotal // Fill in the blanks of the following: cout <<The preferred soda is<< cout << The preferred snack is< cout << Out of << << endl; << endl; people <<chose these items << end; cout << Each of these products were given a rating of K< cout <<from our expert tasters < endl; cout <The other products were rated no higher than a << rating << endl; return e Exercise 1 Fill in the indicated code, then compile and run the program. Continue to work on the program until you have no syntax, run-time, or logic errors. The output should look similar to the following: The preferred soda is Dr. Dolittle The preferred snack is crackers Out of 250 people 148 chose these items! Each of these products were given a rating of A from our expert tasters The other products were rated no higher than a B Exercise 2: ls it possible to change the choice of FAVORITESODA by adding code within the main module of the program? Why or why not? Exercise 3: Is it possible to change the choice of favoriteSnack by adding code within the program? Why or why not?

can you use C++ basic to write this simple program .

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution