# Austin Community College Prototype of a Void Function Questions

I don’t understand this C++ question and need help to study.

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.

2-

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: “

3-

Write C++ statements that call a 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.

4-

Write an if statement that prints the message “The number is valid” if the variable growth_rate is within the range 0-20 (inclusive)

5-

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: 23.0*num+52 and store the answer in result. DO NOT do any read or write operations in the function.

6-

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.

7-

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.

8-

Given the following variables:

float dollars, pounds;

CONV_CONST = 0.64

write 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.

9-

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.

10-

Write a C++ switch statement which sets (assigns) the color value based on a number entered by user. Use variables color (a string) and number (an int). Use the values in this table (assign “null” to the color value if the number is not in this table):

number color

1 red

2 blue

3 yellow

## Don't hesitate - Save time and Excel

Are you overwhelmed by an intense schedule and facing difficulties completing this assignment? We at GrandHomework know how to assist students in the most effective and cheap way possible. To be sure of this, place an order and enjoy the best grades that you deserve!

Post Homework
Top