0% found this document useful (0 votes)
56 views1 page

Total Revenue Price Quantity

This document contains instructions for writing several programs involving variables, data types, user input, and basic mathematical formulas. It asks the reader to: 1. Declare variables of different data types correctly using naming conventions. 2. Write a program to calculate a formula using predefined variable values. 3. Modify the program to prompt the user for the variable values instead of using predefined values. 4. Write a program to greet a user by name after prompting for their name. 5. Write a program to calculate total revenue by prompting for a price and quantity. 6. Write a program to calculate commission by prompting for sales price, cost, and rate.

Uploaded by

Abel Media
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views1 page

Total Revenue Price Quantity

This document contains instructions for writing several programs involving variables, data types, user input, and basic mathematical formulas. It asks the reader to: 1. Declare variables of different data types correctly using naming conventions. 2. Write a program to calculate a formula using predefined variable values. 3. Modify the program to prompt the user for the variable values instead of using predefined values. 4. Write a program to greet a user by name after prompting for their name. 5. Write a program to calculate total revenue by prompting for a price and quantity. 6. Write a program to calculate commission by prompting for sales price, cost, and rate.

Uploaded by

Abel Media
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

------------------------------------------------------------------------------ 7. Write a Program to find the factor of 1400.

Your program should accept an


***** Lab Challenges #2 [ Identifiers, variables and Data Types ] ***** integer number and tell the user whether the number is factor of 1400 or not.
------------------------------------------------------------------------------
8. Write a Program to calculate the area of a rectangle.
1. What would be the correct variable declaration using the the correct identifier
rule: 9. Write a Program that display divisor, factor, quotient & remainder,
• Age of a person. Input should be accepted from the user.
• Income of an employee.
• Number of words in a dictionary.
• A letter of the alphabet.
• A greeting message.
• Gravity

2. Given a = 5 , b = 1 , z = 10 , k = 4, j = 8, and y = 5 , create a program that


outputs the result of the formula

(a – b) x (z – y)
(k2 – 2j)

3. Create a program that uses the same formula above to output the result; this
time, however, prompt the user for the values a , b , x , k , j , and y . Use
appropriate variable names and naming conventions.

4. Create a program that prompts a user for his/her name. Store the user’s name
using the std::cin function and return a greeting back to the user using his/her
name.

5. Create a new program that prompts a user for numbers and determines total
revenue using the following formula:
Total Revenue = Price * Quantity

6. Build a new program that prompts a user for data and determines a commission
using the following formula:
Commission = Rate * (Sales Price – Cost)

You might also like