Concept explainers
Although it is kind of silly, state legislatures have been known to pass laws that “change” the value of pi. Suppose you live in a state where, by law, the value of pi is exactly 3.14. How must you change the
Trending nowThis is a popular solution!
Chapter 2 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
- Write a program that generates a two-column table showing Fahrenheit temperatures from -40F to 120F and their equivalent Celsius temperatures. Each line in the table should be 5 degrees F more than the previous one. Both the Fahrenheit and Celsius temperatures should be accurate to 1 decimal place. Note......BOOK: Introduction to Java Programming and Data Structures, Comprehensive Version, Edition: 11th Author: Y. Daniel Liang Publisher: Pearson ISBN: 9780134670942arrow_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_forwardcan you do it in python, thank you.arrow_forward
- This needs to be done in Java! (Sales Commission Calculator) A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5,000 worth of merchandise in a week receives $200 plus 9% of $5,000, or a total of $650. You’ve been supplied with a list of the items sold by each salesperson. The values of these items are shown below. Develop a Java application that inputs one salesperson’s items sold for last week and calculates and displays that salesperson’s earnings. There’s no limit to the number of items that can be sold. Item Value 1 239.99 2 129.75 3 99.95 4 350.89 Example Output: Enter number sold of product #1: 10Enter number sold of product #2: 20Enter number sold of product #3: 30Enter number sold of product #4: 40Earnings this week: $2182.61 NOTES: Do not create a separate class for this program. Create the…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 in-patient or an out-patient. If the patient was an in-patient the following data should be entered: • The number of days spent in the hospital• The daily rate• Charges for hospital services (lab tests, etc.)• Hospital medication charges.If the patient was an out-patient the following data should be entered:• Charges for hospital services (lab tests, etc.)• Hospital medication charges.Use a single, separate function to validate that no input is less than zero. If it is, it should be re-entered before being returned.Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out- patient data. Both functions should return the total charges.arrow_forwardFor the attached assignment, write a python program, you also need to write: Comments for all the values, constants, and functions IPO Variables Pseudcodearrow_forward
- Transcribed Image Text Python Development Lab In Merworld there exists 2 coins of different denominations types 5-peso coins and 10- peso coins, both having two faces with image of – Elon Musk and a dog. You are assigned a task to find out the number of ways to arrange these coins so that their sum is N pesos. Arrangement should be done in such a way that the first coin in the arrangement should always have Elon Musk image up. Other coins could have any image. Input Output 1 60 5 LOarrow_forwardthis code should be in python: you will be implementing a simple Tic-Tac-Toe game without the graphics.Here is how it works: • First, it is randomly determined if the user starts the game or the computer and thisinformation is shown to the user. The player who starts always starts as “X”.• The players (computer and the user) will then take turns in playing. The computer willchoose a random empty spot on its turn. The user enters its choice in the console.• Each of the empty spots have a corresponding number that the players choose on theirturn. If the user enters anything other than the number of an empty spot (not yet filledwith “X” or “O”), it will not be accepted, and they will be prompted to enter a correctnumber. • After each turn, two things need to be done: 1) displaying the updated board 2) checkingif anyone has…arrow_forwardIn pythonarrow_forward
- IN Python Code Only Jessie has a lot of cooking with her (N). He often remembered the first few letters of the recipe and forgot the others. Like all great chefs, Jessie re-calculated the recipes according to the priority. So, looking at the list of recipes and priorities answers Jessie's questions. Response from Jessie: Giving the first few letters of the recipe; you have to print the perfect recipe in the most important way. Note: Every recipe has a unique value. Input 1 flour-with-eggs 100 1 G Output 0arrow_forwardWrite a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card.arrow_forwardIn python Programming, Suppose you have four dogs named Leo, Tom, Jerry, and Jack, and four dog food bowls labeled 1, 2, 3, and 4. Each bowl can hold up to sixteen scoops of food and each dog chooses a separate bowl, but it doesn't matter which dog uses which bowl. For their dinner each day, you distribute sixteen scoops of dog food into the bowls, so each bowl will receive a whole number units of food. You are pretty careless, and you sometimes leave some bowls empty. If you always put out the full sixteen units of food each day, how many ways can you distribute the food among the four bowls?arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning