Ace - AI Tutor
Ask Our Educators
Textbooks
My Library
Flashcards
Scribe - AI Notes
Notes & Exams
Download App
Amkele

Amkele

Divider

Questions asked

INSTANT ANSWER

The Kilometres / Litre for this tank was 13.75 Enter the litres used (-1 to end): 16.5 Enter the kilometres driven: 272 The Kilometres / Litre for this tank was 16.4848 Enter the litres used ( -1 to end): -1 The overall average Kilometres/Litre was 15.1385 Question 2 Develop a C++ program that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available: a) Account number (an integer) b) Balance at the beginning of the month c) Total of all items charged by this customer this month d) Total of all credits applied to this customer's account this month e) Allowed credit limit 1 The program should use a while statement to input each of these facts, calculate the new balance ( \( = \) beginning balance + charges credits) and determine whether the new balance exceeds the customer's credit limit. For those customers whose credit limit is exceeded, the program should display the customer's account number, credit limit, new balance, and the message "Credit Limit Exceeded". Enter account number (-1 to end): 100 Enter beginning balance: 5394.78 Enter total charges: 1000.00 Enter total credits: 500.00 Enter credit limit: 5500.00 New balance is 5894.78 Account: 100 Credit limit: 5500.00 Balance: 5894.78 Credit Limit Exceeded. Enter Account Number (or -1 to quit): -1 The output (in this case new balance) should be printed in a floating-point number format and with two digits of precision to the right of the decimal point. Question 3 One large chemical company pays its salespeople on a commission basis. The salespeople each receive R200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells R5000 worth of chemicals in a week receives R200 plus 9 percent of R5000, or a total of R650. Develop a C++ program that uses a while statement to input each salesperson's gross sales for last week and calculates and displays that salesperson's earnings. Process one salesperson's figures at a time. Enter sales in rands ( -1 to end): 5000.00 Salary is: R650.00 Enter sales in rands ( -1 to end): 6000.00 Salary is: R740.00 Enter sales in rands ( -1 to end): \( \mathbf{7 0 0 0 . 0 0} \) Salary is: R830.00 Enter sales in rands ( -1 to end): -1 The salesperson 's earnings should be printed as a fixed-point value with a decimal point and with two digits of precision to the right of the decimal point.

View Answer
divider
INSTANT ANSWER

Write a c++ program that reads in five integers and determines and prints the largest and the smallest integers in the group. Use only the programming techniques you learned up to now.

View Answer
divider
INSTANT ANSWER

Write a c++ program that reads in the radius of a circle and prints the circle's diameter, circumference, and area. Use the constant value 3.14159 for p. Do all calculations in output statements.

View Answer
divider
INSTANT ANSWER

Using only the techniques you learned up to now, to write a c++ program that calculates the squares and cubes of the integers from 0 to 10 and uses tabs to print the following neatly formatted table of values: integer square cube 0 0 0 1 1 1 2 4 8 . // up to . 10 100 1000

View Answer
divider
INSTANT ANSWER

Write a program that reads an integer and determines and prints whether it is odd or even. a) first the program using if statements b) then the program using if/else statements

View Answer
divider
INSTANT ANSWER

Write a c++ program that reads in two integers and determines and prints if the first is a multiple of the second. a) first the program using if statements b) then the program using if/else statements.

View Answer
divider
INSTANT ANSWER

A mail order house sells five different products whose retail products are:product 1:R2.98, product 2:R4.50, product 3:R9.98,product4:R4.49 and product5:R6.87.Write a C++ program that reads a series of pairs of numbers as follows:a) product number b)quantity sold.Your program should use a switch statement to determine the retail price for each product. Your program should calculate and display the total retail value of all products sold.Use a sentinel-controlled loop to determine when the program should stop looping and display the final results.The output should display the total retail value as a fixed-point value with a decimal point and with two digits of precision to the right of the period.

View Answer
divider
INSTANT ANSWER

modify the c++ in question 11(precious question asked)so it uses only intergers to calculate the compound interest.Then "break" the results into its rand portion and cents portion by using the division and modulus operations.Insert a period

View Answer
divider
INSTANT ANSWER

The factorial function is used frequently in probability problems. The probability of a non-negative interger n,written n!(and pronounced "n factorial"),is the product: n*( n 1)*(n 2)*...* 1. With 1! equal to 1, and 0! defined to be 1.In other words it is the product of all positive integers less than or equal to n.For example,5! is the product of 5*4*3*2*1 which is equal to 120.Write a c++ program that evaluates factorials of intergers 1 to 5.Print results in a tabular format.

View Answer
divider
INSTANT ANSWER

Question 10 The factorial function is used frequently in probability problems. The factorial of a nonnegative integer \( n \), written \( n \) ! (and pronounced " \( n \) factorial"), is the product \[ n \cdot(n 1) \cdot(n 2) \cdot \ldots \cdot 1 \] with 1 ! equal to 1 , and 0 ! defined to be 1 . In other words it is the product of all positive integers less than or equal to \( n \). For example, 5 ! is the product of \( 5 \cdot 4 \cdot 3 \). \( 2 \cdot 1 \), which is equal to 120 . Write a program that evaluates factorials of integers 1 to 5. Print the results in tabular format.

View Answer
divider