Concept explainers
(You should do
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Absolute C++
Additional Engineering Textbook Solutions
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Concepts of Programming Languages (11th Edition)
Java How To Program (Early Objects)
Web Development and Design Foundations with HTML5 (8th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Computer Science: An Overview (12th Edition)
- You are working for a lumber company, and your employer would like a program that calculatesthe cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber.Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: (image 1) The lumber is sold in different dimensions (specified in inches of width and height, and feet oflength) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which whendivided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and fourinteger numbers. The integers are the number of pieces, width, height, and length. The letter willbe one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When theletter is T, there are no integers following it on the line. The program…arrow_forwardWrite a program that computes and displays the charges for a patient's hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: • The number of days spent in the hospital • The daily rate Hospital medication charges • Charges for hospital services (lab tests, etc.) The program should ask for the following data if the patient was an outpatient: • Charges for hospital services (lab tests, etc.) • Hospital medication charges The program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient information. Both functions should return the total charges and display it for the user. After the total charges have been calculated and displayed, write the result to a file, PatientReport.txt. You can use the techniques you learned in Chapter…arrow_forwardThis is for a c++ class Write a program that will be used as an app to help users compute the tax and tip on a restaurant bill. The program should first ask the user to enter the charge for the meal. The program should then prompt the user whether the meal is in-restaurant "restaurant" or whether it will be carry-out "carry-out." If a meal is in-restaurant, it is taxable and should be taxed. The California tax rate is 7.25 percent so you will need to add that much of the meal charge if the meal is in-restaurant. The program should then prompt the user on whether the service was excellent ("Excellent"), good ("Good"), or typical("Typical"). The tip should be then be 30 percent, if service was excellent, 20% if it was good, or 15% if it was typical. Note that the tip is computed based on the subtotal (before tax if applicable). Display the meal charge, the type of order (in-restaurant or carry-out), tax amount if applicable, tip amount, and total bill on the screen. Example input:…arrow_forward
- Use your previous working Java program as a starting point (Project 3). Create another function that determines whether the customer should receive a discount. Assume your food truck gives a 10% discount on orders over $50 (the total BEFORE tax). If the order is eligible for a discount, then calculate and display the discount. If the order does not get a discount, then still display the discount, but it should be 0. Include a line before this that tells every customer that your business gives a 10% discount on all orders over $50 so they understand this part of their receipt. You will also create two classes, one for existing project two called foodTrack and another class called foodDiscount that extends foodTrack. This is project 3: //initialize program import java.util.Scanner; public class Main { finalstatic String items[]=new String[]{"FRIES","CHEESESTEAK","BISCUIT","SALADBOWL","DONUTBOX","SALESTAX"}; finalstaticfloat…arrow_forwardUse C++ Please do not copy and paste the same answer that is found on google. I have tried to get this to compile in visual studio and it always fails.arrow_forwardin C# Sometimes figuring letter grades is hard. Write a program that asks for, and reads from the user, a midterm exam grade and a final exam grade. Compute the average of those two grades and ouput a letter grade based on the scale shown below. CHALLENGE PROBLEM: One of my graduate school classes modified the above calculation. This professor said that the final grade would be determined by the simple average of the midterm and the final, however, if the student scored better on the final than they did on the midterm, the professor would weight the midterm exam at 25%, and the final exam at 75% when computing the final grade. Modify your code to use this professors modification in determining letter grade. Here is the grading scale:arrow_forward
- You need to write a program that analyses the savings of a child who wants to buy a bike. Your program needs to get the initial saving, the number of weeks the analysis will be done and it will report the amount of savings at the end of the number of weeks entered and it will also make an assessment of the savings. Your program will have two functions to complete the task: f. double savings (int w, double initial savings):Assume that the child can save 20 TL per week and the amount of savings in the current week compared to the previous week is: savings (w) = 1.1savings (w-1) + 20 Write a recursive function that computes the total amount of savings at the end of week, w with the initial amount of savings given to the function. Please note that in week 0, your total amount of savings is the initial_savings given to the function. And In every week, you receive 1% increment of your savings because they are deposited in the bank. void analysis (double savings, int bike_price): This…arrow_forwardf. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…arrow_forward1. Write a program that converts miles to feet. If the distance is more than 15,000 feet, tell the user it might be beneficial to drive the distance. Print the distance in both regular and scientific notation (Note: 1 mile = 5280 feet).arrow_forward
- 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_forwardPYTHON PROGRAMMINGarrow_forwardProgram 1: Write a program that asks the user to input a sentence and then outputs the sentence back with the case of every character reversed. So for example: “CaTs RuLe!” would be given back as “cAtS rUlE!” . Spaces and punctuation should be left in place. You can use the Character class static functions to test the case of each letter. You do not need to place any code in static methods (besides the main method), you do not need to worry about try/catch blocks, and you do not need to make the program run more than once. in javaarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning