Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Absolute C++
Additional Engineering Textbook Solutions
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out with Python (4th Edition)
Starting Out With Visual Basic (8th Edition)
Starting Out with C++: Early Objects (9th Edition)
Mechanics of Materials (10th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
- Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönderarrow_forwardWrite a program that do the following unit conversion based on user menu selection in python: (use while loop until the user enter ‘99’ selection to Quit) 1. Calculate Interest Rate 2. Calculate Mortgage 99 Quit If the user selects 1, then calculate interest rate. Create a python function that will continuously ask the user for inputs to calculate interest earned until the user enters a number 0 (zero) in principle. Once the user enters any number less than or equal to 0 in principle, the program will exit. The program should use while loop to ask the user for inputs. Assume the following variables: p is the initial principle balance r is the annual interest rate n is the amount of times the interest compounds in a year t is the number of years To calculate balance the formula used should be: total = p*(1+float(r/100)/n)**(n*t) interest = total - p Use import to include this function in the main program. If user choice selection 2, then calculate mortgage. For this, you need to…arrow_forwardWrite a program that reads from the user 7 lines of input. Each line includes a team's name (String) and number of goals this team scored in the FIFA World Cup (integer). The program should calculate and print the average number of goals scored by a team. Sample Input and Output: In each line (and for 7 teams), insert a team's name and number of goals this team scored: Brazil 12 Lebanon 16 France 22 Syria 13 Spain 14 USA 24 υAE 15 The average of goals scored is 16.571420571428573arrow_forward
- A. Write a program that asks the user to enter a number of seconds.• There are 86400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86400, the program should display the number of days in that many seconds.• There are 3600 seconds in an hour. If the number of seconds entered by the user is less than 86400, but is greater than or equal to 3600, the program should display the number of hours in that many seconds.• There are 60 seconds in a minute. If the number of seconds entered by the user is less than 3600, but is greater than or equal to 60, the program should display the number of minutes in that many seconds.B. Write a function named biggest that receives three integer arguments and returns the largest of the three values.arrow_forwardWrite a program that prompts the user to enter the month and first day of the month, and displays all the Sundays in that month. For example, if the user entered the month 7 for July, and the first day 4 for Wednesday, your program should display the following output:arrow_forward. . 1. Write a program that asks and prints student information (name, age, allowance per month). The number of students whose information must be collected will be stated at the start of program execution. After the inputting process, all student info will be displayed. A prompt will show telling the user if he/she wants to continue; if "Y/y", inputting student info will again commence; if "N/n", the program will terminate. Any inputs other than "Y/y" or "N/n" . STUDENT DETAIL DB Enter number of students: 2 . Enter Student 1 name: Karlo Cris Enter Student 1 age: 24 Enter Student 1 allowance per month: 20000 Enter Student 2 name: Yuan Kyrie Enter Student 2 age: 20 Enter Student 2 allowance per month: 15000 Student 1 Details ➖➖➖➖➖ Name: Karlo Cris Age: 24 Allowance Per Month: 20000.0 .... Student 2 Details will not be accepted and will loop to the prompt until a valid input is given. Coding Requirements: Name: Yuan Kyrie Age: 20 Allowance Per Month: 15000.0 Try again? (Y/N): G Invalid…arrow_forward
- 3. Write a program that picks a random number between 1 and 100 inclusive. It then prompts the user to guess the number. If the user guesses the number, print out a congratulatory message and exit. Otherwise, indicate whether the guess was low or high and ask the user to try again. Hint: Use the rand() function.arrow_forwardWrite a program that request a user to enter ten numbers at random and compute the following:i. The average of all even numbers enteredii. The product of all odd numbersiii. The total of all the numbers Your program should use a do while loop the repetitive operation required. B. When a loan is taken or an investment is made we calculate the interest of which the loan or the investment will attract. It is often referred to as simple interest. Write a C++ program to compute the simple interest.arrow_forwardPlease use python idle program and take a screenshot of the executable codearrow_forward
- At one college, the tuition for a full-time student is $8000 per semester. It has been announced that the tuition will increase 3 percent each year or the next 5 years. Write a Visul Basic program with a loop that displays the projected tuition amount for the next 5 years. Use a constant for the percentage of change and for the starting tuition. Print the tuition amounts with a dollar sign and two decimal places.arrow_forwardA parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a program that calculates and prints the parking charges for each of three customers who parked their cars in this garage yesterday. You should enter the hours parked for each customer. Your program should print the results in a neat tabular format and should calculate and print the total of yesterday’s receipts. The program should use the function calculateCharges to determine the charge for each customer. Your outputs should appear in the following format Sample output Enter the hours parked for 3 cars: 1.5 4.0 24.0 Car Hours Charge 1 1.5 2.00 2 4.0 2.50 3 24.0 10.00 TOTAL 29.5 14.50arrow_forwardWrite a program that allows the user to enter a series of exam scores. The number of scores the user can enter is not fixed; they can enter any number of scores they want. The exam scores can be either integers or floats. Then, once the user has entered all the scores they want, your program will calculate and print the average of those scores. After printing the average, the program should terminate. You need to use a while loop to allow the user to enter numbers, one at a time, until some numeric sentinel value is entered. I recommend having a sentinel like 9999, something unlikely to be confused with an exam score. If the user enters a score < 0 or > 100 that is not the sentinel value then that score is to be rejected. Each time a legit score is entered, however, it should be added (appended) to a list. Once the user has entered all the numbers they want, calculate and display the average of the scores rounded to 1 decimal place. I attached my solution. I can not fix two…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,