Select Page

COSC 1337 NVCC C++ Statements Sales Tax Rate Float Variables Exam Practice

Question Description

I’m working on a c++ test / quiz prep and need a sample draft to help me study.

Write 1 or more C++ statements that will multiply the variable sales by the constant SALES_TAX_RATE and put the result in tax .

For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac

8 mins ago

QUESTION 2

  1. Write 1 or more C++ statements that will print on the screen the value of a float variable pizza_charge with a dollar sign and two decimal places after the words “The total amount for pizza is: “
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

7 mins ago

QUESTION 3

  1. Write a C++ function that has a floating point parameter called distance. Your function should print the following sentence with the parameter inserted in the blank space: The sun was _____________ miles from this planet. The function should not return any value.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac

7 mins ago

QUESTION 4

  1. Write an if statement that prints “Too many Cats” if variable cats divided by variable mice is greater than or equal to 1.0, and prints “Too many MIce” otherwise.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

6 mins ago

QUESTION 5

  1. Write C++ statements that sum the numbers 2 through 8 (inclusive) and print the final sum. NOTE: you must use a count-controlled (for) loop.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

6 mins ago

QUESTION 6

  1. Write a prototype for a void function named process that has 2 parameters: a character value called code and a floating-point value called amount.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

6 mins ago

QUESTION 7

  1. Write C++ statements that call the above function named process that has 2 parameters: a character value called code and a floating-point value called amount. Declare any variables you use in your call.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

5 mins ago

QUESTION 8

  1. Write a C++ loop that will read integers from the keyboard until a negative number is entered. When the loop is complete, print the sum of all the numbers that were entered. DO NOT INCLUDE the negative number in the sum.
    For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac).

5 mins ago

QUESTION 9

  1. Write a C++ switch statement which sets (assigns) the life expectancy of a light bulb based on its wattage. Use integer variables life and wattage. Use the values in this table (assign 0 to the life expectancy if the wattage is not in this table):wattage life expectancy25 250060 100075 750

4 mins ago

QUESTION 10

  1. Write a code segment that creates an ofstream object named outfile, opens a file named numfile.txt, and associates it with outfile. Then write the contents of the variable data to the file, followed by a new line, and close the file.

4 mins ago

QUESTION 11

  1. Write a void function that has two parameters – a value parameter called num that receives a floating point number from the calling function and a floating point reference parameter called result. The function should do this calculation: 25.0*num+37 and store the answer in result. DO NOT do any read or write operations in the function.

3 mins ago

QUESTION 12

  1. Extra Credit: 5 Points Max (No points deducted)Given the following variables:float dollars, pounds;CONV_CONST = 0.64write the code that will convert US Dollars $ to English Pounds £ (assume that 1 Dollar = .64 Pounds). Input the dollars from the keyboard and print the calculated results with 2 decimal places.

3 mins ago

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now