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.
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 4, Problem 43PS
Write a
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
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write a program in python that prints a pyramid made of letters in the middle of the screen. Use functions with parameters for this assignment. The base width of the pyramid is determined by a character the user enters. If the user enters the letter o, the following pyramid will be printed. It can be assumed that the screen width is 80 characters.
a aba abcba abcdcba abcdedcba abcdefedcba abcdefgfedcba abcdefghgfedcba…
Each function should accept two integer parameters indicating the minimum and maximum X value to be plotted. The functions should have no return values. Create class-level constants for things we might wish to change later, e.g., a char called PLOT_CHAR that holds an “x” (per samples below), another char called FILL_CHAR that holds an unobtrusive character like ASCII 183, generated with a cast, e.g., (char)183.
JAVA PLEASE
THOSE ARE NOT PERIODS OR DOTS.
USE (System.out.print((Char)183); for (.)
Please DON'T USE Loops(while);, if, Arrays, lists, or other data structures, objects, libraries, or methods.
Sideways Ploty = 20sin(.5x)+20 where -11<=x<=11
··································x
·······································x
·······································x
···································x
···························x
·················x········x·xx···x··········x····················x
·····························x
····································x…
Draw a bar chart of 5 values entered by the user (>=0), where the y-axis is along the rowsand the x-axis is along the columns of the screen (as shown in the figure below).Function Prototype: void barChart(int N1, int N2, int N3, int N4, int N5)Example01:***********************************************************marks: 02Input:N1=>8 , N2=>6 , N3=>2 , N4=>10 , N5=>910 *09 * *08 * * *07 * * *06 * * * *05 * * * *04 * * * *03 * * * *02 * * * * *01 * * * * *1 2 3 4 5
Note: Take input in main function. don't use arrays or any other library other than iostream.
Chapter 4 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 4 - Prob. 1PSCh. 4 - The function definition contains the code for a...Ch. 4 - Function calls that return void may not be used as...Ch. 4 - The address operator (&) is used to tell the...Ch. 4 - Variables defined within a block have global...Ch. 4 - Prob. 6PSCh. 4 - Which of the following statements about function...Ch. 4 - Which of the following is not a part of a function...Ch. 4 - Which of the following statements about function...Ch. 4 - Which of the following statements about local...
Ch. 4 - Prob. 11PSCh. 4 - Prob. 12PSCh. 4 - Which of the following statements will generate a...Ch. 4 - Which of the following statements about structure...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function calls:...Ch. 4 - Evaluate the value of the following expressions:...Ch. 4 - Evaluate the value of the following...Ch. 4 - Prob. 23PSCh. 4 - Define the range of the random numbers generated...Ch. 4 - What would be printed from Program 4-17 when run...Ch. 4 - Prob. 26PSCh. 4 - Prob. 27PSCh. 4 - Prob. 28PSCh. 4 - Prob. 29PSCh. 4 - Write a program that generates a random number...Ch. 4 - Prob. 31PSCh. 4 - Code and run Program 4-16, "Top—down Development...Ch. 4 - Prob. 33PSCh. 4 - Prob. 34PSCh. 4 - Expand the calculator program, Program 4-15, to...Ch. 4 - Prob. 36PSCh. 4 - Write a function that receives a positive...Ch. 4 - Prob. 38PSCh. 4 - Prob. 39PSCh. 4 - Prepare a payroll earnings statement for the sales...Ch. 4 - Write a program that, given a beginning balance in...Ch. 4 - The formula for converting centigrade temperatures...Ch. 4 - Write a program that uses standard functions. The...Ch. 4 - Write a C program that creates customers' bills...
Knowledge Booster
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
- Write a program that calculates the Euclidean distance and the Manhattan or taxicabdistance between two two-dimensional points. Make sure you 1) use a point structureto store the points (see above), 2) use functions to calculate the two distances and3) ask the user for the point data. The Euclidean distance is calculated using thePythagorean Theorem for (points (x1,y1),and (x2, y2):euclidean = ( x1-x2)^2 + ( y1-y2)^2And the Manhattan distance is calculated as:manhattan = | x1-x2 | + | y1-y2 |arrow_forwardWrite a function which accepts the user’s first and last name and prints the first name 4 timesseparated by tabs, and last name 2 times separated by spaces. (1 tab = 4 spaces)Example OutputEnter the first name: JohnEnter the last name: MorganJohn John John John Morgan Morganarrow_forwardIn Python, please Write a program that asks user to enter email address. Program then checks and prints whether email entered by the user is valid. Structure your program to have two functions: isEmailValid function that takes a string as parameter and returns True or False depending on whether the input string matches all the requirements of a valid email listed main function that repeatedly prompts the user for the email address, calls isEmailValid method passing the user entered string, saves the returned value reports whether the email is valid or not depending on the returned value. asks user if he/she wants to continue. If so, repeats above steps. Otherwise ends the program. Use the recommended strategy of calling the main function use "if __name__ ..." format. Email should be of the form first.last@bellevuecollege.edu. It should have a '.' a '@' should end with "bellevuecollege.edu" index of first '.' should be less than the index of '@' there should be only one '.'…arrow_forward
- write a program that asks the users to input three numbers (x,y,z) and calculate the sum, subtraction, multiplication, and division of the numbers (x/y)/z using functions. There is also a function to print the results. note: inputMe, sumMe, subtractMe, multipleMe, DivideMe, ResultMe are the names of the functions. The results should be the same as: The result of sum is: ..... The result of subtract is: .... The result of multiply is: ..... the result of divide is: ......arrow_forwardDraw a bar chart of 5 values entered by the user (>=0), where the y-axis is along the rowsand the x-axis is along the columns of the screen (as shown in the figure below).Function Prototype: void barChart(int N1, int N2, int N3, int N4, int N5)Example01:***********************************************************Input:N1=>8 , N2=>6 , N3=>2 , N4=>10 , N5=>910 *09 * *08 * * *07 * * *06 * * * *05 * * * *04 * * * *03 * * * *02 * * * * *01 * * * * *1 2 3 4 5 Example 02:***********************************************************marks: 02Input:N1=>8 , N2=>6 , N3=>0 , N4=>11 , N5=>711 *10 *09 *08 * *07 * * *06 * * * *05 * * * *04 * * * *03 * * * *02 * * * *01 * * * *1 2 3 4 5Example 03:***********************************************************marks: 02Input:N1=>4 , N2=>3 , N3=>1 , N4=>0 , N5=>004 *03 * *02 * *01 * * *1 2 3 4 5Note: Take input in main function.arrow_forwardWrite a program that asks the user to enter five test scores. The program should display letter grade for each score and the average test score. Write the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score based on the following grading scale: Score Letter Grade 90–100 A 80–89 B 70–79 C 60–69 D Below 60 F javascriptarrow_forward
- Project 5 Please write a program that computes the average of 3 exam scores of 3 students. It first asks the user three exam scores for each student and then compute the average of them. The program should have the following functions. • int getTestScore(): This function is called by main function. It asks the user to enter the score of the exam. Once it gets a user input data, the function returns it to the main function. Input Validation: Please check if the entered score is between 0 and 100 inclusive (considered valid). If not, repeat asking to enter a valid score. • double calAverage(int, int, int, int, int): This function is called by main function. It calculates the average of 3 exam scores passed from main function in int data type. Once the function calculates the average, it returns it to main function in double data type. • void display(string, double): This function is called by main function and displays the student’s name and average exam score. The arguments are…arrow_forwardWrite a python program that creates two global variables, one to store the number of incorrect guesses and a second to store a word (example: koala). Write a function called print_hangman() that takes no arguments and prints a hangman corresponding to the number of incorrect guesses (use the global variable).arrow_forwardCreate a program in Python, called TA_Calculator, that uses a function tocalculates the area of a triangle given the base and height measurements. Use thebelow function to do your calculationThe program should receive the base and the height from the user. Once the userenter a base greater than the height the program should give the user anotherattempt to enter a base and a height. The program only give the user threeattempts to enter the correct base and height on the third attempt the programshould display the below message:“You have exhausted your 3 attempts please try again later”arrow_forward
- CHALLENGE ACTIVITY 6.7.3: Function with loop: Shampoo. Write a function print_shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1 : Lather and rinse. 2 : Lather and rinse. Done. Hint: Define and use a loop variable. Use Python, please.arrow_forwardi need help with this project Description: Write a program that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests the bingo card for a winner via 2 users Steps: 1- Ask user 1 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 2- Ask user 2 to enter 24 numbers between 10-40 no duplicates / check for range and repetition 3- Using function, design 2 BINGO cards as you see below 4- Distribute the numbers onto the 2 cards with each user input with 0 in the middle 5- Display the 2 cards in 1 screen as you see below 6- Using function, generate a random number between 10-40 no duplicates / check for range and repetition 7- Using function, compare the random number with the numbers on the 2 cards 8- If the random number matches any number on each card, change the number on the card to 0 9- Using function, check for winning 5 numbers in a row or column = 0 5 numbers in a diagonal = 0 all 4 corners of the card = 0 if any of the…arrow_forwardWrite a program that prints a pyramid made of letters in the middle of the screen. Use functions with parameters for this assignment. The base width of the pyramid is determined by a character the user enters. If the user enters the letter o, the following pyramid will be printed. It can be assumed that the screen width is 80 characters. The following assignments make use of functions with return values ("fruitful functions"). So if the user enters the letter o it will print thearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
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