Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Write a C++ code for this prompt:
Summary
In an elementary school, a mixture of equal amounts of nuts and dried fruit is provided during lunch. Suppose that the number of calories in each pound of nuts is 0.70 times the number of calories in each pound of dried fruit.
Instructions
Write a
- The number of students in the elementary school
- The number of calories required for each student from the mixture
- The number of calories in each pound of nuts.
The program outputs:
- The amount of nuts and dried fruit needed for the students.
For simplicity, assume that each student requires the same amount of calories.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
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
- In C++ Programming, write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions: Federal Income Tax: 15% State Tax: 3.5% Social Security Tax: 5.75% Medicare/Medicaid Tax: 2.75% Pension Plan: 5% Health Insurance: $75.00 Your program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your output to have two decimal places. A sample output follows: Bill Robinson Gross Amount: .......................... $3575.00 Federal Tax: ................................ $ 536.25 State Tax: .....................................$ 125.13 Social Security Tax: ................... $ 205.56 Medicare/Medicaid Tax: ......... $ 98.31 Pension Plan: .............................. $ 178.75 Health Insurance: .......................$ 75.00 Net Pay: ....................................... $2356.00 NOTE: The first column is left-justified, and the right column is…arrow_forwardDevelop a pseudocode or flowchart for all the following problems : 1. Write a program which will display “I AM GOOD” on the computer screen for 10x2. Write a program which will display “I AM GREAT” on the computer screen for 100x3. Write a program which will display “I AM SUPERMAN” on the computer screen for 1000x4. Accept two integers from computer user and check whether they are equal or not.5. Write a program to check whether a given number is even or odd.6. Write a program to check whether a given number is positive or negative7. Write a program to read the value of an integer m and display the value of n is 1 when m is larger than 0, 0when m is 0 and -1 when m is less than 08. Write a program which accept the user’s height in cm then display :a. You are so tall → if the height is more than 180cmb. You are not that tall → if the height is between 100 – 179cmc. You are short ha ha ha → if the height is less than 100cm9. Write a program to read 10 numbers from keyboard and find their…arrow_forwardC level program 1. Write a program that takes an integer n as input (from Keyboard) and compute and display (a) The sum of digits. (b) The integer with digits reversed, and multiplied by 3. For example, if the input is 4318, then in part (a), you'll display integer 4318, and sum of digits 4 + 3 + 1 + 8 = 16; and in part (b), you'll compute and display 8134 and also 24402, which is 4318 * 3. (c) Test your program with 3 integers: 4318, 401, and an integer of 5 digits of your choice. Show and explain source code and show outputarrow_forward
- python Write a program that prompts the user to enter the number of study hours of a student and the average of the student. Then the program is checking the following:- If the average of the student is greater than 4 and the number of hours is less than 26, then the program should display "You have a chance".- Otherwise, the program should display "You do not have a chance".arrow_forwardPLEASE COMMENT CODE Write a Python program that does the following Asks the user to enter the order. If the order is greater than $1000, there is 17% discount, if the order is greater than $800 and less or equal to $1000, the discount is 13%, if the order is less or equal to $ 800 but greater than $ 500, the discount is 9%, otherwise the discount is 5%. The tax percent is 13%. The program calculates the total invoice of the customer after the appropriate discount and the tax amount are applied. The program prints out the customer name (entered by the user), the discounted amount, the tax amount and the total invoice. The program asks if the user wants to continue using the application with a new order (y/n). Sample run: Please, enter the name of the customer: John Smith Please, enter the total of your order: $1100 Customer name: John Smith The order amount: $1100 The discounted…arrow_forwardUsing introduction to Python You have been asked to write an application that automatically grades a quiz. The quiz has 15 multiple-choice questions. The correct answers are: 1.A, 2.C, 3.A, 4.B, 5.B, 6.D, 7.D, 8.A, 9.C, 10.A, 11.B, 12.C, 13.D, 14.C, 15.B The program will start by creating a list holding the quiz answers key shown above. It will then prompt the user for the student name and their answers file and read them into a separate list. It will finally compare the key vs. answers lists to calculate & display: Number of correct answersNumber of incorrect answersQuestions incorrectly answered.Whether the student has passed or failed the quizA student must correctly answer 11 out of 15 questions to pass.The user can grade as many students as they wish. Notes The file containing the student’s answers is organized as 15 lines. Each line contains the answer to the corresponding question. The responses are single character strings, from A to D, uppercase. Must use functional…arrow_forward
arrow_back_ios
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