Create your program using eclipse

Assignment Help JAVA Programming
Reference no: EM13768576

Assignment 5

Goal

In this assignment you will program a menu-based calculator and practice using...
• Switch statements
• Loops

Requirements

Your program will perform one of two options repeatedly until the user quits your program.

• Create your program using Eclipse. Name your project Assignment5 and the Java class Loops.

• Use the Scanner class to get input from the user and use System.out to print to the console window.

• Use a while (or a do...while) to have the program loop until the user enter -1

• Inside the while, display a menu similar to the one below and use switch statement to respond to the user's choice

Please enter one of the following choices:

1 --> Largest Number

2 --> Factorial

-1 --> Quit

• For the Largest Number:

o Use ANOTHER while (or a do...while) loop ask the user to input an integer greater than or equal to 0 or -1 to quit.
Input an integer greater than or equal to 0 or -1 to quit:

o When the user enters -1, print out the largest number found

• For the Factorial:

o Ask the user for an integer that we will calculate the factorial.

o In math the factorial is notated as "n!". It is the product of all positive integers less than or equal to n. For example, 5! =5x4x3x2x1= 120. Meanwhile 3! = 3 x 2 x 1 = 6

o Here are the factorial rules

• If the integer is negative, display an error message

• Else if the integer is 0, then 0! = 1 so automatically print 1 as the answer

• Else calculate the factorial with a for loop and display the result.

o When finished, display the result

o Hint: use the factorial result as a long and not an int as the values can get quite large

• Display the result in a readable format.

• Be sure to comment your code.

Reference no: EM13768576

Questions Cloud

Largest supplier of home goods in the northeast : You are a new procurement manager with the largest supplier of home goods in the Northeast. The owner of the corporation is considering discontinuing the contract for the shipping of goods. He wants the corporation to invest in its own fleet of tr..
Different staffing levels : Analyze the primary way in which different staffing levels may play pivotal roles in upholding ethical conduct, including treating patients with dignity.
What degree you believe harley-davidson is proceeding : Discuss to what degree you believe Harley-Davidson is currently proceeding towards its mission, vision, and values - Identify two or three of H-D's most important stakeholders and discuss whether Harley-Davidson's current strategic direction is alig..
Analysis of an environmental disaster : Recent environmental disasters have significantly impacted the human population in multiple ways. In this assignment, you will identify a recent environmental disaster and discuss potential correlated health impacts.
Create your program using eclipse : Create your program using Eclipse. Name your project Assignment5 and the Java class Loops. Use the Scanner class to get input from the user and use System.out to print to the console window.
What is the companys approach to sustainability : What is the company's approach to outsourcing and/or offshoring? What is the company's approach to sustainability?
Resources to use in researching a bankruptcy issue : What is the standard for a consumer debtor to obtain discharge of a student loan on the grounds of "undue hardship"? Describe the resources to use in researching a bankruptcy issue
Aggregate demand curve is negatively sloped : Aggregate demand curve is negatively sloped in part because of the impact of interest rates and the economy is in short-run equilibrium.
Issues in the automotive technology department : After introducing yourself to the secretary you share with a half dozen other, more senior, people, you decide to focus on hazardous material and hazardous waste issues since you just completed a great college course on those topics. You tour the ..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd