Concept explainers
Write a
Oranges: 10 for $2.99
Eggs: 12 for$1.69
Apples: 3 for $1.00
Watermelons: $4.39 each
Bagels: 6 for $3.50
Then calculate the cost of each of the following five items and the total bill:
2 dozen oranges
3 dozen eggs
20 apples
2 watermelons
1 dozen bagels
Trending nowThis is a popular solution!
Learn your wayIncludes step-by-step video
Chapter 5 Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Concepts Of Programming Languages
Computer Science: An Overview (12th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Starting Out With Visual Basic (7th Edition)
C++ How to Program (10th Edition)
- Python In this assignment, a game called treasure hunt will be written object oriented.There are 3 types of treasures in the game. Diamond, Emerald and Gold. Diamond is 100 points, Emerald 70 points and Gold is 50 points.There are thieves in the game that will prevent you from hunting for treasure. Encountering a thief they steal some of your treasure. You will randomly generate which thief will steal from which treasure and how much.At the beginning of the game, the player has no treasure. X, Y, Z and H will be randomly identified at the start of the game. Define X Diamonds, a random number between X -> 100-200.Let a random number be defined between Y Emerald Y -> 100-200.Define a random number between Z Gold Z -> 100-200.You will define H thieves. Let it be defined between H -> 5-20. It will collect these randomly selected treasures to the player.For example:1- Diamond2-Emerald3-Diamond4-Gold5-Thief (k = treasure to steal, n = how many pieces he can steal)6-Gold.... In…arrow_forwardThe Huntington Boys and Girls Club is conducting a fundraiser by selling chili dinners to go. The selling price is Rs.7 for an adult meal and Rs.4 for a child's meal. Write a class that accepts the number of each type of meal ordered and display the total money collected for adult meals, children's meals, and all meals. Moreover, assume the cost price to produce an adult meal and a child's meal are Rs.4.35 and Rs. 3.10, respectively. Further, create a method to display the total profit for each type of meal as well as the grand total profit. Use javaarrow_forward//Todo write test cases for SimpleCalculator Class // No need to implement the actual Calculator class just write Test cases as per TDD. // you need to just write test cases no mocking // test should cover all methods from calculator and all scenarios, so a minimum of 5 test // 1 for add, 1 for subtract, 1 for multiply, 2 for divide (1 for normal division, 1 for division by 0) // make sure all these test cases fail public class CalculatorTest { //Declare variable here private Calculator calculator; //Add before each here //write test cases here }arrow_forward
- Write a JAVA program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with 6 seats in each row. Rows 1 and 2 are first class, rows 3 to 7 are business class, and rows 8 to 13 are economy class. Your program prompts the user to enter the following information: Ticket type (first class, business class, or economy class) Desired seat ‘*’ indicates that the seat is available; ‘X’ indicates that the seat has been assigned. Make this a menu-driven program; show the user’s choices and allow the user to make the appropriate choices.arrow_forwardWrite the program in python. Write a class called BuildersGame that represents the board for a two-player game that is played on a 5x5 grid. During the game, each players' builders will move around the board and add levels to towers. The winner is the first one to move a builder on top of a 3-story tower. First, x places her two builders on the board, then o places her two builders on the board. Throughout the game, no two builders can ever occupy the same square. After the initial placements are complete, x must move either one of her builders to an adjacent square (one square orthogonally or diagonally). Builders always move to the top of the tower on their destination square. Builders can move any number of levels down, but can move at most 1 level up (they can also stay at the same level). You can visualize it as the builders hopping from the top of one tower to the top of another, but they can never move to a tower that is more than one level higher than the tower they're on.…arrow_forwardPython Languagearrow_forward
- 1. In the game of Monopoly, a pair of dice are rolled to move a player's piece around the board. If a double is rolled (the dice show the same number), the player receives another roll of the dice. If a double is rolled a second time, a third roll of the dice is received. If a double is rolled on the third occasion, the player forfeits their turn (and goes to Jail). Write a program which simulates two players having 50 turns each (a turn however many dice rolls a player has in a row before it's the other player's turn) and determines: a) the total number of spaces moved by each player; and b) how many times a player rolls a double which results in movement of a piece. Use the randi function. For fun, incorporate the rule that a player cannot leave Jail (cannot move) unless they either roll a double or three turns have passed without rolling a double.arrow_forwardCode in javaarrow_forwardPROGRAMMING LANGUAGE: C++ ALSO PUT SCREENSHOTS WITH EVERY TASK. TASK 1 : A class of ten students took a quiz .The grades (integers are in range 0-100) for this quiz are available to you .Determine class average on quiz . TASK 2: Write c++ code that print summery of exam result and decide either student should have makeup class or not .If more then 30% of class fails in exam it’s mean they need a makeup class otherwise they don’t need any makeup class. For class strength take input from user (Hint: take two variables pass and fail) TASK 3: write a c++ that will determine whether a department-store customer has exceeded the credit limit on the charge account .For each customer , following facts are available : Account number (an integer) Balance at beginning of month Total of all items charged by this customer this month Total of all credit applied to this customer’s account this month. Allowed credit limit You are required to use a while structure to input each of these facts ,…arrow_forward
- Programming in Python Unit 3 Assignment2InstructionsWrite a program to simulate a bank transaction. There are two bank accounts: checking and savings.First, ask for the initial balances of the bank accounts; reject negative balances and set to zero. Then askfor the transaction; options are deposit, withdrawal, and transfer. Then ask for the account; options arechecking and savings. Then ask for the amount; reject transactions that overdraw an account. At theend, print the balances of both accounts.arrow_forwardWrite in Java pleasearrow_forwardStarting Out with Java From Control Structures through Objects 6th Edition 4. Paint Job Estimator A painting company has determined that for every 115 square feet of wall space, one gallonof paint and eight hours of labor will be required. The company charges $18.00 per hourfor labor. Write a program that allows the user to enter the number of rooms to be paintedand the price of the paint per gallon. It should also ask for the square feet of wall space ineach room. The program should have methods that return the following data: • The number of gallons of paint required• The hours of labor required• The cost of the paint• The labor charges• The total cost of the paint jobThen it should display the data on the screen.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT