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++
The programming language is python.
Any 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
20
Chapter E Solutions
C++ How to Program (10th Edition)
Knowledge Booster
Similar questions
- How 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_forwardYou 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_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 C++ program that computes student grades for an assignment as a percentage given each student's score and the total points. The final score should be rounded up tothe nearest whole value using the ceil function in the <cmath> header file. You should also display the floating-point result up to 5 decimal places. The input to the program must come from a file containing multiple lines wih the student's last name, score, and total seperated by a space. In addition, you should print to the console "Excellent" if the grade is greater than 90, "Well Done" if the grade is greater than 80, "Good" if the grade is greater than 70, "Need Improvement" if the grade is greater than or equal to 60, and "Fail" if the grade is less than 60. Here is an example of what the input file might look: Weems 50 60 Dale 51 60 Richards 57 60 Smith 36 60 Tomlin 44 60 Bird 45 60 Make sure you design your program in such a way that it prompts the user for the pathname leading to the…arrow_forward
- Use C++arrow_forwardThis is a c++ programming question. Write a header file called apple.h It should contain the following items: - a macro which gets one input parameter and return the square of the input value. - an inline function which gets two float type input parameters and returns the greater value. - a symbolic constant called M which has the value 100.arrow_forwardWrite a simple calculator program with four operations: add, subtract, multiply, and divide. Create a separate function for each that returns the result of the operation (for example, an “add” function that returns the sum of two values). In the main() function, the program should ask the user to enter two numbers (floating point type) separated by a '+', '-', '*', or '/' character. The program should then call the appropriate function and display the result of the operation.arrow_forward
- I submitted this question earlier and it was stated to be too complex. Below I will post what I have as an answer so far(almost complete). In C++, Steps The system should show the following top menu. Write a function that simply displays this menu. Sign in Balance Deposit Withdraw Exit We assume that this ATM machine holds account for only 10 people. So, use an array to store client’s account balance. Suppose all accounts start with an initial balance of $1000. With this structure in mind we use array indices (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) as user’s account number (a single digit) and array values as balances. The user must first sign in to use the machine by entering their account number (0, 1, 2, 3,.. 9). If the user enters an incorrect account number the system should give a warning message and display the menu again. User can request account Balance by entering option 2. Write a function to complete the following task: The system displays the current balance. If balance…arrow_forwardusing C++ In this exercise you would be using a text input file to store a number of students first and last names, and each students scores in test1, test2, midterm, final and homeworks. Now, you get all the stored in relevant arrays. Write a function that will accept all the scores and compute the average score for each student. You can pass only one student’s information at a time while calling the function. Write another function for the grade computation. Display your results with last name, first name, average score and grade for each student. Display should be on screen as well as in an output file.arrow_forwardWrite a program that calculates the area (a) of a triangle given two values b (base) and h (height) and using the formula area = (base * height) / 2 .The program should include a function called calculate_area which has two input parameters(b and h) and one output parameter (a).The user is prompted to enter two input values that will be used as base (b) and height (h) thenthe function calculate_area uses those two values as input parameters returns the calculatedarea (a) as an output parameter. After using the function calculate_area the program shoulddisplay the calculated area (a).Hint: use a pointer for the output parametearrow_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