Question

Give meaningful identifiers for the following variables and write a proper C++ declaration and initialization to...

Give meaningful identifiers for the following variables and write a proper C++ declaration and initialization to a reasonable value. (1, 6, 7) Submit your answer to dropbox.

a. A variable to store the letter grade, (A, B, C, D, or F).

b. A variable to store the sales tax price of an item.

c. A variable to store the number of juice bottles sold.

d. A variable to store the billing amount of a doctor's visit.

e. A variable to store the grade point average (GPA).

0 0
Add a comment Improve this question Transcribed image text
Answer #1
a. A variable to store the letter grade, (A, B, C, D, or F).
char letterGrade;

b. A variable to store the sales tax price of an item.
double itemTax;

c. A variable to store the number of juice bottles sold.
int noOfJuiceBottles;

d. A variable to store the billing amount of a doctor's visit.
double billingAmount;

e. A variable to store the grade point average (GPA).
double GPA;
Add a comment
Know the answer?
Add Answer to:
Give meaningful identifiers for the following variables and write a proper C++ declaration and initialization to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to...

    Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. a -31 es" (a%b) * 6; e-(a b+ d)/ 4 10. Which of the following variable declarations are correct? If'a variable declaration is not correct, give the reasoníy) and provide the correct variable declaration. n = 12; char letter int one = 5, two; //Line 3 double x, Y zi //tine...

  • hi, can you help me please with this quesions. Total: 19 marks Identify the following variables...

    hi, can you help me please with this quesions. Total: 19 marks Identify the following variables as quantitative or qualitative. (5 marks: 1 mark for each statement) a) The rate of change of a population (1 mark) b) A letter grade in a course (1 mark) c) A person's favourite kind of music (1 mark) d) The number of calories per 100 grams of a food item (1 mark) e) A person's monthly salary (1 mark) Analyze each statement below...

  • Write your final answers on the lines. Show your computations. Use correct symbols. 1. For the...

    Write your final answers on the lines. Show your computations. Use correct symbols. 1. For the following variables determine the level of measurement and whether the variable is discrete or continuous The time it takes a rat to run a maze Rank in the Army Number of students enrolled in PSY 202 Race (as in Asian, etc.) 2. How would the following mathematical operation be expressed in summation notation? "Add two to each score, square the resulting values, then add...

  • Assignment #1: Write a C++ Program. Consider the following program segment. // Name: Your Name //...

    Assignment #1: Write a C++ Program. Consider the following program segment. // Name: Your Name // MU ID: Your ID // include statement (s) l using namespace statement int main() //variable declaration //executable statements // return statement a. Include the header files isotream. b. Include cin, cout, and endl. c. Declare two variables: numi, num2, num3, and average of type int. d. Assign 125 into numi, 28 into num2, and -25 into num3 e. Store the average of numi, num2,...

  • Write the following program in C++. Review structures, pointers and dynamic memory allocation from CSIT 839....

    Write the following program in C++. Review structures, pointers and dynamic memory allocation from CSIT 839. Also, review pointers and dynamic memory allocation posted here under Pages. For sorting, you can refer to the textbook for Co Sci 839 or google "C++ sort functions". I've also included under files, a sample C++ source file named sort_binsearch.cpp which gives an example of both sorting and binary search. The Bubble sort is the simplest. For binary search too, you can refer to...

  • This program should be written in C Thoroughly following the Code Conventions, write an efficient program,...

    This program should be written in C Thoroughly following the Code Conventions, write an efficient program, which ask the user for their numeric grade, and determines and displays the equivalent letter grade, based on the following information: Use appropriate data types and initialize the variables correctly Use the following grading scale: A: 90 - 100 B: 80 - < 90 C: 70 - < 80 D: 60 - < 70 F: 0 - < 60 If the input is invalid,...

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • This is for C++ Write a program that reads in a sequence of characters entered by...

    This is for C++ Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must...

  • ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following...

    ELEC 1520 Homework - Integer Operations, Selection Statements Instructions Write C++ programs to solve the following two problems. Upload your source code files to Canvas. The file names must be of the form coins_your_name.cpp and bonus_your_name.cpp for problems 1 and 2, respectively. Substitute your first and last name for "your_name" in the file name. Problem Statements 1. Given a value V in cents, you need to make change using a minimum number of coins. Assume you have an infinite supply...

  • You should test out your script using the following matrices. 2 3 1 2 3 1 C D- 3 2 B- A- -3 8 4 8 2 4 4 1 You may n...

    You should test out your script using the following matrices. 2 3 1 2 3 1 C D- 3 2 B- A- -3 8 4 8 2 4 4 1 You may not use any special MATLAB tools. Instead, work symbolically and derive general expressions for the eigenvalues and the eigenvectors. For instance, you may not use the SOLVE function. If you are not sure whether or not a particular function is available to you, just ask Include your hand...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT