Question: WRITE IN JAVA. thank you This program demonstrates the use of characters and strings PLACE YOUR NAME HERE nclude nclude ing namespace std; Definition of

WRITE IN JAVA. thank you  WRITE IN JAVA. thank you This program demonstrates the use of
characters and strings PLACE YOUR NAME HERE nclude nclude ing namespace std;

This program demonstrates the use of characters and strings PLACE YOUR NAME HERE nclude nclude ing namespace std; Definition of constants nst string FAVORITESODA = "Dr. Dolittle"; // use double quotes for strings nst char BESTRATING = ' A '; // use single quotes for characters tmain() char rating; /1 2nd highest product rating string favoritesnack; I/ most preferred snack int numberofpeople; // the number of people in the survey int topchoiceTotal; / I the number of people who prefer the top choice If Fill in the code to do the following: 11 Assign the value of "crackers" to favoritesnack 1/ Assign a grade of ' B ' to rating If Assign the number 250 to the numberofpeople I/ Assign the number 148 to the topchoiceTotal If Fill in the blanks of the following: cout "The preferred soda is " endl; cout "The preferred snack is " endi; cout "Out of " people " " chose these items!" endl; cout "Bach of these products were given a rating of " ; cout " from our expert tasters" endi; cout "The other products were rated no higher than a " rating endi; return 0; Task: Retrieve program stringchar.cpp from the Program folder. This program illustrates the use of characters and strings. Using the stringchar.cpp files complete the computer program to demonstrate the use of characters and strings. Write two versions of the program, one in Java and one in C++. Your programs must match your algorithm!!! Input: See source code for instructions. Output: The C++ output should complete the source file. Sample output: 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!