Write a Java
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Data Structures and Algorithms in Java
Additional Engineering Textbook Solutions
Management Information Systems: Managing the Digital Firm (15th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Java: An Introduction to Problem Solving and Programming (8th Edition)
C++ How to Program (10th Edition)
- Write a Java program to simulate a blackjack game of cards. The computer will play the role of the dealer. The program will randomly generate the cards dealt to the player and dealer during the game. Cards in this game will be represented by numbers 1 to 13 with Ace being represented by a 1. Remember, that face cards (i.e. Jack, Queen, and King) are worth 10 points to a hand while an Ace can be worth 1 or 11 points depending on the user’s choice. The numbered cards are worth their number value to the hand. Here are the details of how to play the game: To start the game, the player is given two randomly chosen cards and told their values. The dealer is then given two cards randomly. The human player should only be told the value of the first card given to the dealer. The other card in the dealer's hand is "hidden" until the end of the game. The player is then asked if they want to draw another card for their hand. While the player wishes to draw another card and neither hand has gone…arrow_forwardCreate a cashiering system in Java that applies the OOP concept. There should be a receipt that will be shown after that includes the vat of 12%, the subtotal, total amount, cash, change, etc.arrow_forwardWrite a Java procedural program that helps organise travellers with a specific travel company arriving at an airport, telling them which queue to join based on their hotel. The program asks each traveller what their hotel is (the choices are the Seaview for which they need to join Queue 1, the Majestic for which they need to join Queue 4 and the Grand for which they need to join Queue 7) and tells them the right queue. There are 1330 travellers with the tour company and each will use the program as they arrive. After all have indicated their hotel, the program then prints the percentage in each hotel. * See image for an example run of the program. Percentages should be printed truncated to two decimal places. Do this using a method you write yourself that multiplies by 100, converts to an integer then divides by 100. * must make use of a counter-controlled for loop, be in procedural programming style (not OOP)arrow_forward
- JAVA - Please produce both a product.java file and a productprinter.java file (tester) Implement a class Product. A product has a name and a price, for example new Product("Toaster", 29.95). Supply methods getName, getPrice, and reducePrice. Supply a program ProductPrinter that makes two products, prints each name and price, reduces their prices by $5.00, and then prints the prices again.arrow_forwardWrite a java program that may pass for a Basic Calculator with a graphical user interface and OOP paradigm. Your calculator should have functions for: addition, subtraction, multiplication, division, modulo, exponent function(^). Use oop technique and create a class called calculator that provide unique method body for each problem. Thus, your class should have six different method for these (addition, subtraction, multiplication, division, modulo, exponent function(^)) and use the GUI for user interaction.arrow_forwardUSING JAVA: Implement a simple e-mail messaging system. A message has a recipient, a sender, and a message text. A mailbox can store messages. Supply a number of mailboxes for different users and a user interface for the user to login, send messages to other users, read their own messages, and log out.arrow_forward
- Write a Java program that prompts the user for at least two input values. Then write a method that gets those input values as parameters and does some calculation/manipulation with those values. The method than should return a result of the calculation/manipulation back to the main, where it is printed. The program should prompt the user, call the method, and then print a meaningful message along with the value returned from the method.arrow_forwardUsing the card.java class file, write a program to simulate a Deck of Cards. See Programming Project 8.7 (PP 8.7) from page 403 on textbook for a description of what your program needs to do. Note that although the book description of the problem states that you should write the Card class, I do not want you to do that. You must use the Card file exactly as it is provided (NO modifications) and only write the DeckOfCards and Driver classes. public class Card{public final static int ACE = 1;public final static int TWO = 2;public final static int THREE = 3;public final static int FOUR = 4;public final static int FIVE = 5;public final static int SIX = 6;public final static int SEVEN = 7;public final static int EIGHT = 8;public final static int NINE = 9;public final static int TEN = 10;public final static int JACK = 11;public final static int QUEEN = 12;public final static int KING = 13; public final static int CLUBS = 1;public final static int DIAMONDS = 2;public final static int…arrow_forwardWrite a java programImagine a publishing company that markets both book and audiocassette versions of its work. Create a class publication that stores the title (a string) and price(type float) of a publication. From this class derive 2 classes: book, which adds a page count (type int); and tape, which adds a playing time in minutes (type float). Each of theses 3 classes should have a getdata() method to get its data from the user at the keyboard, and a putdata() function to display its data. Suppose you want to add the date of publication for both books and tapes. From the publication class, derive a new class called publication2 that includes this data member. Then change book and tape so ther are derived from publication2 instead of publication. Make all the necessary changes in member functions so the user can input and output dates along with the other data. For the dates, you can use the bulit-in date function which stores a date as 3 ints, for months, day and year. Write a…arrow_forward
- Develop a Java program that simulates a library book checkout system. The program should allow users to check out and return books, maintain a catalog of available books, and display information about overdue books. Follow these guidelines: Create a Book class with attributes like title, author, and availability status. Implement methods to check out and return books, updating the availability status accordingly. Create an array or a collection to store instances of the Book class representing the current catalog. Prompt users to input their library card number before checking out or returning a book for tracking purposes. Keep track of due dates for checked-out books. Assume a standard lending period of 14 days. Display information about overdue books, including the book details and the number of days overdue. Provide feedback messages for successful checkouts, returns, or overdue book information. Include JavaDoc comments for class and method documentation. Utilize single-line…arrow_forwardWrite a Java program that generates detailed information about an available accommodation. The accommodation is described as a fully renovated house on the main floor with a kitchen. It has two unfurnished bedrooms and is located near Oshawa Center, Walmart, and Canadian Tire. The program should provide information about the walking distance to a bus stop and the proximity to Whitby Campus and Oshawa Campus. Serious inquiries are emphasized, and the accommodation is prepared for occupancy on January 1st. The contact numbers for inquiries should also be included in the output. Can you provide a Java program that accomplishes this task?arrow_forwardCreate simple JAVA program. Implement a system that a company would use for recording purchases of items. The system must be capable of recording details of suppliers, and orders sent to suppliers requesting goods. The system must be able to provide a series of reports, for example details of when goods are received and details of payments made.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education