Concept explainers
Exercises 43-50 refer to the following
Write Number2
Write statements that declare the variables used in this program.
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Prelude to Programming
Additional Engineering Textbook Solutions
Starting Out with Python (4th Edition)
Java How To Program (Early Objects)
Starting Out with C++: Early Objects
Java: An Introduction to Problem Solving and Programming (7th Edition)
Starting Out with C++: Early Objects (9th Edition)
- 25. Repeat Programming Exercise 24, but the wire is to be bent in the form of a circle. In this case, the user specifies the length of the wire and the program outputs the radius and area of the circle. (You may assume that . Also declare it as a named constant.)arrow_forward(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.arrow_forward(Sum a Sequence of Integers) Write a program that sums a sequence of integers. Assume thatthe first integer read with scanf specifies the number of values remaining to be entered. Your program should read only one value each time scanf is executed. A typical input sequence might be5 100 200 300 400 500where the 5 indicates that the subsequent five values are to be summed.arrow_forward
- Software Sales (see Chapter 3, Programming Exercises 12): A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10–19 10% 20–49 20% 50–99 30% 100 or more 40% Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. Submit: Algorithm, Python code with documentation, Outputarrow_forwardThe Salary Program: Modify the program from the textbook (Program 1-1,see below) which reads the number of hours an employee works reads the pay rate per hour computes the pay for the employee. Add the following steps: a) Read an amount of bonus paid to the employee.b) Compute the total pay as pay plus bonus.c) Compute the tax at 30% of the total pay.d) Compute the net pay as total pay minus tax, and e) Print a report showing: total pay, tax deduction, and net pay. Algorithm: 1. Prompt the user for number of hours.2. Read the value for hours.3. Prompt the user for hourly rate.4. Read the hourly rate.5. Prompt the user for amount of bonus.6. Read the value for bonus.7. Compute the pay.8. Compute the totalPay by adding bonus to pay.9. Compute the tax deduction by multiplying 30% times totalPay.10. Compute the netPay by subtracting tax from totalPay.11. Neatly print and label the following: a. totalPay b. tax c. netPay Put your…arrow_forwardQuestion 1 aaaa Computer Science A program needs to store an inventory item’s name, height, and weight. Using the values in the table below, write the code to create the variables. Needs to be written in Pythonarrow_forward
- Examine the following program. // This program uses variables and literals. #include using namespace std; int main() { int little; int big; little = 2; big = 2000; cout << "The little number is " << little << endl; cout << "The big number is " << big << endl; return 0; } List all the variables and literals that appear in the program.arrow_forward5-1) (Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number.arrow_forwardA function is a block of code that performs .a specific task True O False Oarrow_forward
- 2. Sum, Avg, Min, Max This is similar to the exercise we did in class but with two changes: (1) Use doubles instead of ints; (2) The user will be providing the numbers. Just like the class exercise, output the sum, average, highest, and lowest of the user's numbers. Output: This program will ask you to enter 5 numbers with decimal places. It will then show you the total, average, largest number, and smallest number. Enter a number: [user types: 5.2] Enter a number: [user types: 9.8] Enter a number: [user types: 2.5] Enter a number: [user types: 17.5] Enter a number: [user types: 7.5] Total: 42.5 Average: 8.5 Lowest: 2.5 Highest: 17.5arrow_forwardC++ Write a program to check a number is prime or not. The number must be taken. From userarrow_forward52. To write a program functions such as input four numbers and print their sum, program refinement second level includes a. print the values b. print the variables c. input four numbers d. calculate sumarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr