Computer Science: A Structured Programming Approach Using C, Third Edition
Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 43PS

Write a program that uses standard functions. The program may be written entirely in main and must follow the pseudocode shown in Algorithm 4-1. Give the output appropriate captions, and align the data.

ALGORITHM 4-1 Pseudocode for Project 43

1 Prompt the user to enter a number

2 Read number

3 Display number

4 Get a random number and scale to range 3...37

5 Display random number

6 Set product to number * random number

7 Display product

8 Display ceiling of random number

9 Display floor of product

10 Display number raised to power of random number

11 Display square root of random number

Blurred answer
Students have asked these similar questions
Task 2: Using Function-Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is: 5 C = (F-32) Where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of Fahrenheit temp. 0 through 20 and there Celsius equivalents. The program should display the number of numbers found in the file, the sum of the numbers, and the average of the numbers.
SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of last five years. The data should be collected for n employees. The value of n should also be accepted as input. All amounts should be displayed with three decimal places. The output should be displayed as a table containing the Employee name, Average Sales and Bonus. The program must define and use a function with Total Sales as a parameter and should calculate the Average Sales and Bonus for each employee. Bonus must be calculated based on the following table: Average Sales (AS) AS<5000 5000ZAS<7500 7500ZAS<10000 AS210000 Bonus 1% of Average Sales 2% of Average Sales 4% of Average Sales 7% of Average Sales Sample Output Employee Name Average Sales Bonus AFRAH ASMA ATHEER НАЈAR 8577.000 6476.800 4943.000 343.080 129.536 49.430 718.200 315.064 135.608 352.888 365.072 305.240 303.216 10260.000 MALLAK 7876.600 6780.400 8822.200 9126.800 MARYAM NOORA SAHAR SHEFAA 7631.000 TAGHARID 7580.400
SalaryStmt.py Write a python program that accepts name of an employee and employee's yearly sales of last five years. The data should be collected for n employees. The value of n should also be accepted as input. All amounts should be displayed with three decimal places. The output should be displayed as a table containing the Employee name, Average Sales and Bonus. The program must define and use a function with Total Sales as a parameter and should calculate the Average Sales and Bonus for cach employee. Bonus must be calculated based on the following table: Average Sales (AS) AS<5000 50002AS<7500 75002AS<10000 AS210000 Bonus | 1% of Average Sales 2% of Average Sales 4% of Average Sales 7% of Average Sales Sample Output ====: Employee Name Average Sales Bonus === AFRAH 8577.000 343.080 ASMA 6476.800 129.536 4943.000 10260.000 ATHEER 49.430 718.200 315.064 135.608 352.888 365.072 305.240 НАЈАR HAJAR 7876.600 6780.400 8822.200 9126.800 7631.000 7580.400 MALLAK MARYAM NOORA SAHAR SHEFAA…

Chapter 4 Solutions

Computer Science: A Structured Programming Approach Using C, Third Edition

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Computer Programming for Beginners | Functions, Parameters & Arguments | Ep24; Author: Programming With Avelx;https://www.youtube.com/watch?v=VXlh-qJpfw0;License: Standard YouTube License, CC-BY