Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Computer Science: An Overview (12th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
- Read the following scenario: To implement an exam, an instructor first notifies the students of the exam date and the topics to be covered. The instructor will prepare the exam paper, gets it copied to produce enough copies for the class, and hands it out to students at the designated time and location. The students attempt their answers to exam questions and hand in their answer papers to the instructor. The instructor then gives the answer papers to the tutor, along with sample solutions to each question, and gets them to mark it. The tutor will then records all the marks and return the answer papers to the students. After the answer papers have been returned to the students, they can raise any issues or queries about the marks they received. The instructor then reviews these queries/issues and decides whether marks adjustments are needed. If there are marks adjustments, the instructor will request the tutor to make the necessary changes in the marks record. Draw a sequence diagram…arrow_forwardYour task is to write a program that computes paychecks. Employees are paid an hourly rate for each hour worked; however, if they worked more than 40 hours per week, they are paid at 150 percent of the regular rate for those overtime hours. Name an actor class that would be appropriate for implementing this program . Then name a class that isn't an actor class that would be an appropriate alternative. How does the choice between these alternatives affect the program structure? Implement the appropriate class and solve the problem. You need to test your code using a separate main class program named "exel.java” Javaarrow_forwardSuppose you have some rupees in your hands. You can buy from this money something from that shop where billing is done in rupees. Suppose you go to such a shop for buying where only dollars are accepted, you cannot use your rupees there. This money is like a class. A class can fulfill only a particular requirement. It is not useful to handle different situations. Now suppose you have a credit card. In a shop, you can easily pay in rupees by using your credit card. If you go to another shop where dollars are accepted, you can also pay in dollars. The same credit card can be used to pay in pounds also. But how is this credit card paying in different currencies? Let’s understand it. Basically, a credit card is like an interface that performs several tasks. It is a thin plastic card that contains identification information such as your name, bank name, and perhaps some numbers. It does not hold any money physically. But here question is that how are shop keepers able to draw money from…arrow_forward
- Write a program to play an automated dice game that uses two dice (GVDie class provided). The player rolls both dice and either wins one credit, loses one credit, or sets a goal for future rolls. Current round ends when player wins or loses a credit. Game ends when credits are zero.Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.Step 0. Read starter template and do not change the provided code. Two GVDie objects are created. A random seed is read from input and passed to a die. This supports automated testing and creates predictable results that would otherwise be random. Starting credits is read from input. Step 1 Roll both dice. Player wins one credit by rolling 7 or 11. Player losses one credit by rolling 2, 3, or 12. Otherwise, credits do not change and the player's goal is set to the dice total. The player's goal must be repeated in…arrow_forwardUse java and classesarrow_forwardJava, we are covering decisionsarrow_forward
- 3) Suppose an airline company has hired you to write a program for choosing the passengers who should leave an overbooked flight. That means the airline has booked too many passengers hoping some of them would not show up on time, but passengers are on board and the aircraft doesn't have enough seats available for all these passengers. Your program chooses the passenger who must leave the flight. Passengers will be ranked based on the fare they have paid for booking (a double number called fare), and their number of loyalty points (an integer number called points). Fare and points are equally important, that means, in order to decide the position of each passenger in the list, fare and points each have 50% importance. A Person with minimum priority (combination of fare and points) will leave the flight. You need to define a class called Passenger with these member variables: passenger's name • fare points. Passenger class must have 3 accessors, 3 mutators, a constructor with three…arrow_forwardInstructor note: This lab is part of the assignment for this chapter. This lab uses two Java files, LabProgram.java and SimpleCar.java. The SimpleCar class has been developed and provided to you already. You don't need to change anything in that class. Your job is to use the SimpleCar class to complete the specified tasks in the main() method of LabProgram.java Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar object that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status The SimpleCar class is found in the file SimpleCar.java. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 milesarrow_forwardThis assignment is supposed to represent a group of students in a course. A group of students in a course will be assigned an assignment and produce a collection of assignment results. The results will be used to figure out grade statistics. The grade they receive for their work on the assignment is entirely dependant on the student's energy level. If the student works on many assignments without sleeping their grade will suffer. You will implement four classes (Assignment, AssignmentResult, Student, and Course), they will depend on each other in the order they are listed. Hint: Work on the methods in the order they are found in the documentation below, implement the getter and setter methods before the more complicated methods. Work on the Assignment class, AssignmentResult class, Student class and Course class in that order. Make sure you don't name your class variables the same name as you class's methods. In other words if you have method named id you cannot have a class…arrow_forward
- In python how do you: Complete the FoodItem class by adding a constructor to initialize a food item. The constructor should initialize the name to "None" and all other instance attributes to 0.0 by default. If the constructor is called with a food name, grams of fat, grams of carbohydrates, and grams of protein, the constructor should assign each instance attribute with the appropriate parameter value. The given program accepts as input a food item name, fat, carbs, and protein and the number of servings. The program creates a food item using the constructor parameters' default values and a food item using the input values. The program outputs the nutritional information and calories per serving for both food items. Ex: If the input is: M&M's 10.0 34.0 2.0 1.0 where M&M's is the food name, 10.0 is the grams of fat, 34.0 is the grams of carbohydrates, 2.0 is the grams of protein, and 1.0 is the number of servings, the output is: Nutritional information per serving of None:…arrow_forwardIN C++ programming This question is inspired by the famous Uno card game. Write an activity that takes two arguments: (1) the player's current hand and (2) the current upward card on the table. Work will be back true if the player is able to make the game, or false if the player must draw on the deck. A player can make a game if: They have a card the same color as the upside card. They have the same number card as the upside card. canPlay (["yellow 3", "yellow 7", "blue 8", "red 9", "red 2"], "red 1") => trutharrow_forwardUse Java.arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning