
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
hey can someone help me with this java intellij assignment, i want the output to come as whole numbers not a decimal. If someone can write the code already

Transcribed Image Text:Lab2C: For this assignment, create a program that will read in a width and height from the user and
calculates the area and perimeter of a rectangle. The formula for perimeter is P = 2*(height+width)
and the formula for area is A = (height*width). Format the outputs following this sample run. User
input is in bold. Both the class and filename should be called Lab2C (.java, .cs,
.cpp).
Sample run:
Enter a width: 4
Enter a height: 8
The area is 32.
The perimeter is 24
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Can someone please help me to write the full code in the shown pictures in Java eclipse. Thank you!arrow_forwardHello! I am having trouble trying to write out the code that is supposed to begin by creating the "framework" of my Yahtzee Java program and I am just not sure on how to go about it. There are instructions (//***) at the very end of the code on what I have to write out, but that is where I am having trouble. Can you also write the comments that explains the "why" and "how" for each code as well? Thanks and I appreciate it. Here is what I have so far: public class YahtzeeP1 { final static int SCORE_NO_VALUE = -1; static int aces = SCORE_NO_VALUE; static int twos = SCORE_NO_VALUE; static int threes = SCORE_NO_VALUE; static int fours = SCORE_NO_VALUE; static int fives = SCORE_NO_VALUE; static int sixes = SCORE_NO_VALUE; static int threeKind = SCORE_NO_VALUE; static int fourKind = SCORE_NO_VALUE; static int fullHouse = SCORE_NO_VALUE; static int smallStraight = SCORE_NO_VALUE; static int largeStraight =…arrow_forwardHello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with: //***//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE//***//*** 1) Write a public static method named "calculateUpperSectionCategory" that//*** returns int and that receives an int parameter named "dieNumber".//***//*** 2) Write the method body code as follows://*** A) Declare a variable named "score" of int datatype.//*** B) Initialize variable "score" to the value of 0 (zero).//*** C) Write a println statement that displays the message://*** "In method calculateUpperSectionCategory".//***…arrow_forward
- 1. Write Java code to repeatedly print each single digit between 1 and 9 the number of times based upon its numeric value. Thus, you would get a triangle of the shape below where 1 prints once, 2 twice . and 9 prints 9 times. 1 22 333 4444 55555 666666 7777777 88888888 999999999arrow_forwardWhich one is greater 0.0 or double minimum value in java. Also verify your answer.arrow_forwardHello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with: * The code given below is going to be modified based on the instructions in bold. // These are the declared die values.static int die1, die2, die3, die4, die5; public static int calculateFullHouse() {int score;score = 0;boolean isFullHouse;isFullHouse = false; System.out.println("In method calculateFullHouse"); return score;} //*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE//***//*** Modify your "calculateFullHouse" method as follows://*** 1) Remove the System.out.println statement.//***//*** 2) Write an if-statement…arrow_forward
- Hello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with: //***//*** INSTRUCTIONS FOR CODE FOR YOU TO WRITE//***//*** 1) Write a public static method named "isGameOver" that//*** returns boolean and receives no parameters.//***//*** 2) Write the method body code as follows://*** A) Declare a variable named "gameOver" of boolean datatype.//*** B) Initialize variable "gameOver" to the value of false.//*** C) Write ONE if-statement whose condition is a Compound Boolean Expression comprised of thirteen (13) //*** Boolean Expressions using the &&…arrow_forwardIn Java 8, I want the program to capture the current year and compare it to an input value. Specifically, the user is asked to enter the last two digits of a year that will be output. If those two digits are greater than the last two digits of the current year, the program will print to console a “19” before the two digits the user inputted. If the two digits that the use input are less than or equal to the last two digits of the current year, the program will print to the console a “20” before the two digits the user inputted. For instance, if the current year is 2023, and the user input the integer number “74”, the program would output to the console “1974”. If the current year is 2023, and the user input the integer number “19”, the program would output to the console “2019”. The user is not asked to enter the current year; the program captures that automatically. The user only enter the last two numbers of a year. Hopefully, that's enough to go by and clear enough. I need the code,…arrow_forwardHello! I am having trouble on how to write out the Java code based on the instructions (in bold //***) that I am given. As a note, this specific Java code is a code that is going to setup the basic framework for a game of Yahtzee. In other words, you will need to understand the rules of Yahtzee and implement the rules into coding. Could you also add comments to each line of code when you write out the codes for this as welI? I appreciate the help. Thanks! Also, I am using the IntelliJ IDEA application when writing out this program. Here is what I need help with: public static void displayScoreSheet() { final String ACES_LABEL = "Aces"; final String TWOS_LABEL = "Twos"; final String THREES_LABEL = "Threes"; final String FOURS_LABEL = "Fours"; final String FIVES_LABEL = "Fives"; final String SIXES_LABEL = "Sixes"; final String THREE_KIND_LABEL = "3 of a kind"; final String FOUR_KIND_LABEL = "4 of a kind"; final String…arrow_forward
- This assignment will help you to get started with NetBeans and using Java compiler: To begin, put a block comment at the beginning of your Java file (and every Java source file in the future) with the assignment number, assignment title, program author [your name], and the date it's due. Next, similar to the programs presented in the first chapter of the textbook, use System.out object to display the following information: Your first name The name of the operating system you are using The name of your project (or simply the folder name if not using the IDE) The name of the class that contains the main() method in your source file. Note: Your program should print each of the above items on a separate output line. "The name of the class that contains the main() method in your source file.public class MyClass { public static void main(String[]) { System.out.println( "Hi" ); }}arrow_forwardI am trying to write a java code to see if the number entered by the user is a factor of the random number generated from the import java.util.Random. When I run it it keeps saying the number entered by the user is not a factor of the random number. Another thing is the output is suppose to look like this... The value <number entered by user> is a / not a factor of <random number> how would I fix what i have to look like that?arrow_forwardHey all, Need some help on best way to go about this question. All coding is done in Java. I am using the IntelliJ Idea, as the base for the code if it helps. Question is as follows: A car’s miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven / Gallons of gas used Write a java program that prompts the user for the number of miles driven and the gallons of gas used. It should calculate the car’s miles-per-gallon and display the result on the screen.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education