C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
C++
python" You have an Internet connection with a download speed of 41 Megabits per
second (Mbps) and you want to calculate how long it will take to download a files based
on their size.
Write a function named "download_time" that takes an integer as a parameter. The
parameter represents the size of a file in Gigabytes that you want to download. The
function should return the number of seconds it will take to download that file if your
download speed is 41 Megabits per second. To convert the file size from Gigabytes to
Megabits remember that 1 Gigabyte equals 1000 Megabytes and that 1 Megabyte equals
8 Megabits.
2. Test Scores
File: test_scores.py
Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score.
When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data.
Remember that we've done the JCU grades question before, so copy your function from that practical code file.
Sample Output
Score: 3
Score: 50.5
Score: 66
Score: 100
Score 3.0, which is N
Score 50.5, which is P
Score 66.0, which is C
Score 100.0, which is HD
The average score was 54.875
Enhancements
When you have that working...
We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant?Change 4 to 3... Did you have to change the program in more than one place?If so, then you've missed one of the things we've taught...As a strong guideline: if you need to use the same literal more than once, you…
Chapter E Solutions
C++ How to Program (10th Edition)
Knowledge Booster
Similar questions
- The programming language is python.arrow_forwardAny help would be greatly appreciated!! If you could attached screenshots of the code that would be very helpful!! Write code for the following: Write Python code that uses a loop to prompt the user for five floating point numbers and reports the sum of the floats when the loop ends. Write Python code that defines a void function named divide that takes two numbers as parameters and then prints the quotient accurate to 1 decimal place when the first parameter is divided by the second one. A file named txt is shown on the right. Write Python code that opens this file, reads only the first two lines, and prints “Penny is 19” Penny 19 Kenny 20 Benny 21 Jenny 20arrow_forwardHow can I write a python program with a main function that imports a custom module file. The custom module file defines a function that takes the radius of a circle as its only parameter. In the module's custom function: calculate the area and circumference of the circle and use an f-string to print one precisely formatted line as follows: the radius should display centered with one decimal place in a column 8-characters wide. the area should be centered with four decimals in a column 12-characters wide. the circumference should also be centered with four decimals in a column 12-characters wide. outputs in the thousands should display commas. In the main function: print headings for the columns with the same alignments and widths. run a loop that will go through seven iterations. inside the loop generate a random integer from 40-80, inclusive. execute the function in the custom module with the random integer as its argument.arrow_forward
- example the name is Jack Robert , ID 53605 in C language. thank youarrow_forwardNEED CODE IN C++ IN VISUAL STUDIO AND OUTPUT Write a program to print the factorial of a number by defining a function named 'Factorial'. Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. For Example:4! = 1*2*3*4 = 243! = 3*2*1 = 62! = 2*1 = 2Also,1! = 10! = 0arrow_forwardPYTHON PROGRAMMINGarrow_forward
- You need to write a program in C that will allow a teacher to store, update and view the grades of multiple students. The program should perform the following operations: Add a new student and their grades for different subjects. View the grades of a particular student. Update the grades of a particular student. View the average grades of all students.The program should store the following information for each student: Student name (string) Roll number (integer) Grades for 5 subjects (integers)The program should implement a menu-driven interface for the user to perform the above operations. The program should continue to run until the user selects to exit.Constraints: The student name should not exceed 50 characters. The roll number should be a positive integer and should be unique for each student. The grades should be integers in the range [0, 100].arrow_forwardIn pythonarrow_forwardA county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. For example, if an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 72¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Write a function that accepts the actual value of a piece of property and displays the assessment value and property tax. JavaScriptarrow_forward
- Python Programming- Computer-Assisted Instruction Part 1: Computer-Assisted Instruction (CAI) refers to the use of computers in education. Write a script to help an elementary school student learn multiplication. Create a function that randomly generates and returns a tuple of two positive one-digit integers. Use that function's result in your script to prompt the user with a question, such as: How much is 6 times 7? For a correct answer, display the message "Very good!" and ask another multiplication question. For an incorrect answer, display the message "No. Please try again." and let the student try the same question repeatedly until the student finally gets it right. Part 2: Varying the computer's responses can help hold the student's attention. Modify the program so that various comments are displayed for each answer. Possible responses to a correct answer should include 'Very good!' , 'Nice work!' and 'Keep up the good work!' Possible responses to an incorrect answer shojld…arrow_forwarda. USING C PROGRAMMING LANGUAGE Write a program to process a collection of the speeds of vehicles. Your program should count and print the number of vehicles moving at a high speed (90 miles/hour or higher), the number of vehicles moving at a medium speed (50–90 miles/hour), and the number of vehicles moving at a slow speed (less than 50 miles/hour). It should also display the category of each vehicle. Test your program on the following data: Speed of vehicles (in miles): 43 23 54 57 68 67 51 90 33 22 11 88 34 52 75 12 78 32 89 14 65 67 97 53 10 47 34 b. Modify your program to display the average speed of a vehicle (a real number) at the end of the run.arrow_forwardWrite a program that will calculate the final velocity and time of travel of a baseball that is thrown downward from a tower of a certain height and initial speed. The program will ask the user to enter height (h) and initial velocity (vo). Create two (2) function files: 1) to calculate the final velocity (v) and 2) calculate the time of travel (t). Display the result of the calculation. Use the formula below for the final velocity and travel time.arrow_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