Write a Java
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Data Structures and Algorithms in Java
Additional Engineering Textbook Solutions
Starting Out With Visual Basic (7th Edition)
Problem Solving with C++ (9th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Using MIS (10th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Programming Logic and Design (4th Edition)
- Write a java program that can suggest an activity based on the temperature. If the temperature is between 20 to 40 degrees Fahrenheit, suggest the user go skiing; if the temperature is between 41 to 60 degrees Fahrenheit, suggest the user go hiking; if the temperature is in the range of 61 to 80, suggest swimming. For all the temperatures out of these ranges (too cold or too hot), then suggest staying inside.arrow_forwardWrite a Java program that prints rectangles of three different sizes to the screen, with a blank line between each rectangle. A 5 x 3 rectangle made of the letter ‘O’ A 16 x 6 rectangle made of the letter ‘T’ A 2 x 4 rectangle made of the left square bracket ‘%’ In the dimensions given above the first number is the horizontal width and the second number is the vertical height of the rectangle. Here is what your output should look like. Your program should be written in a flexible, general way so that the rectangle dimensions and the letter/character used to print each rectangle can be changed easily without rewriting the whole program. OOOOO OOOOO OOOOO TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTT %% %% %% %%arrow_forwardWrite a Java program for a Play-House Manager, who would like to calculate the total profit from selling tickets of the Drama. There are 3 types of tickets: Balcony (120 AED), VIP (70 AED) and Basic (40 AED). The manager has bills and salaries to pay. Therefore, the profit is equal to (incomes – expenses). last time it was wrong codearrow_forward
- Write a program in Java that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first six letters of the first name, followed by the first letter of the last name, an underscore (_), and then the last digit of the number (use the % operator). If the first name has less than six letters, then use all letters of the first name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: MichaeJ_1 Ex: If the input is: Nicole Smith 2024 the output is: Your login name: NicoleS_4arrow_forwardCreate a java program for a credit card payment, the program should ask for a cardholder's name, the cvv of the card and the expiry date of the cardarrow_forwardWrite a java Program that implements a calculator and it should have the 6 basic Operatoin : Addition , Substrsction , multiplication , Division , Mod , Equal , CE(to clear the textfield ) The calculator should be like the following pic but without styling Make a program that implement a Quiz that include 10 Questions ( 2 Per Stage )o the First Stage Contains a Label that contains the question and bellow it a choicesor textfield for the answer and bellow all of these a button “Next” to move to thenext Stageo The other Stages should contain as the same of the first stage in addition of abutton “Previous” to move to previous stageo The last Stage don’t has a next button , although it has “Finish attemp” whenpressing on it it should move to a final stage that include a label with the gradefrom 10arrow_forward
- Write a Java program for a school for assigning students to exam halls. Your program should ask students to enter their student number via keyboard, then tells them in which exam hall they should do their exam. In this school, student numbers have a 6-digit format and range between 212001 to 222999. Your program should assign students to the exam halls as: ▪ If the last two digits of a student number is between 00 to 33, The student is assigned to Hall-x ▪ If the last two digits of a student number is between 34 to 66, The student is assigned to Hall-y. ▪ If the last two digits of a student number is between 67 to 99, The student is assigned to Hall-z. An error message should be printed in the console if the entered student number is not in the range. Note that you may use nested if statements in your program structure. But none of the branching conditions should use logical conjunction or logical disjunction expression.arrow_forwardWrite a Java program with two methods, main and exchange that asks to input two double variables, then prints them, and calls the exchange method to exchanges the values of these two variables. The exchange method receives two values for its parameters, prints them, then exchange values of parameters and prints their new values.arrow_forwardWrite a FULL Java procedural program for one human player to play a “Higher or Lower” card game. In this game, each card has a value from 1..10 inclusive. There are 4 of each value in the deck, i.e., 40 cards in total. Cards are not replaced in the deck once drawn, i.e., no more than 4 of each value will be drawn. The program starts by asking the player for a target score. The game proceeds in a series of rounds with the program repeatedly drawing and showing a card from the deck to the player one at a time. Each time, it asks the player to enter "h" (higher) or "l" (lower) to guess whether the next card drawn will be higher or lower in value. The player gains a point if they guess correctly. The game continues until the player guesses incorrectly or the target score is reached. When the game ends, it prints either a "You win!" or a "Nice try, you scored …” message as illustrated below. The image provided shows two examples of the required program behaviour: (bold is keyboard input…arrow_forward
- Write Pseudocode in Java for a program that uses a bag to manage a clothing store's inventory, the clothing store has 15 red shirts, 30 pairs of pants, and 26 pairs of black shoes. The program should check how many products are in the bag How many duplicate items are in the bag and how many of each item is in the bagarrow_forwardWrite a JAVA procedural program that works out the amount a person has to pay for parking in a carpark in a tourist town. If they say they are disabled, they are told it is free. Otherwise they enter the numberof hours as a whole number (1-8) that they wish to park as well as whether they have an “I live locally”badge or are an old age pensioner both of which leads to a discount. The program tells them the cost to park.The calculation is done in this program as follows. If they are disabled it is free. Otherwise … Take numberof hours they wish to park and give a basic charge:• 1 hour: 3.00 pounds• 2-4 hours: 4.00 pounds• 5-6 hours: 4.50 pounds• 7-8 hours: 5.50 poundsNext modify the resulting charge based on whether they are local or not:• If local: subtract 1 pound• If OAP: subtract 2 poundsYour program MUST include methods including ones that- asks for the hours and returns the basic charge.- asks whether they live locally / are an OAP and returns the amount to subtract. EXPLAIN HOW…arrow_forwardConsider you are programming a library book borrowing system. How to change the status of the book to unavailable after it is borrowed by a client in Java? Write a java program.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