Write program using a switch statement that display polygon

Assignment Help JAVA Programming
Reference no: EM13164632

Write a program using a switch statement that displays the name of a polygon with sides between 3 and 12 depending on the number entered by the user. For example, if the user enters 3, the program should display the string "Triangle". if the user enters 8, the program should display the string "Octogon". If the user enters an invalid number (assume 1 side and 2 sides cannot be polygons), and ( 13 and above are out of the range of the program)...the program should display an appropriate error message. 

Reference no: EM13164632

Questions Cloud

Design a phonecall class that holds a phone number : Design a PhoneCall class that holds a phone number to which a call is placed, the length of the call in minutes, and the rate charged per minute. Overload extraction and insertion operators for the class.
Design a class named checkingaccount : Design a class named CheckingAccount that holds a checking account number, name of the account holder, and balance.include methods to set values for each data field and a method that displays all the account information. Create the class diagram a..
Determine the highest bit rate possible for a circuit : 1. Determine the number of conditions possible for a binary code
Investment strategy your knowledge of algorithms : Planning an investment strategy your knowledge of algorithms helps you obtain an exciting job with the acme computer company, along with a $10,000 signing bonus. you decide to invest this money with the goal of maximizing your return at the end of..
Write program using a switch statement that display polygon : Write a program using a switch statement that displays the name of a polygon with sides between 3 and 12 depending on the number entered by the user
On any given execution your program : On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..
When the jmpc field in the microinstruction is enabled : Assume that when the JMPC field in the microinstruction is enabled (set), MBR is ORed with NEXT_ADDRESS to determine the address of the next microinstruction to be executed
Write a program that prompts for and accepts input of test : write a program that prompts for and accepts input of test ggrades that are integers between 0 and 100. For each numerical test grade,  program should display a corresponding letter grade
A robot can take steps of 1 meter : A robot can take steps of 1 meter, 2 meters, or 3 meters. Write a recursive function to calculate the number of ways the robot can walk n meters. (n is an integer obtained from user.) As example:

Reviews

Write a Review

JAVA Programming Questions & Answers

  On any given execution your program

On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..

  Create a web application for sheridan restaurant

Create a web application for Sheridan Restaurant Reviews that contains the following functionality - Display a table of all restaurants based on the city entered by the user

  Java application to declare and create a vector

Write a java application that perform the following task: declare and create a vector with initial size of 10, increment of 2

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Represent one book in java

Represent one book in java

  Construct a bulls and cows program for my intro java class

construct a Bulls and Cows program for my intro Java class. This program needs to perform the basic functions of the game (determining how many cows there are and how many bulls there are and tell the player when they win), but it also needs to offer..

  Create a bar chart that illustrates sales.

Hal's Used Cars has four salespeople named Pam, Leo, Kim, and Bob. Accept values for the number of cars sold by each salesperson in a month, and create a bar chart that illustrates sales. Save the file as BarGraph.java.

  Finding java code error

Indicate in the given code segment if an error occurs. If so, point to whether it is syntax, runtime or logic and how you would fix it.

  Java program for line item application

This exercise explains you the process of testing and enhancing Line Item application. Open LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.

  Have an array of integers with user input instead of given

change the current code to have an array of integers with user input intead of given input from the main where it says int[] a=....; And also from a text file but the same numbers as what is given in main.

  Java''s type int has limit onhow large aninteger it can store

Java's type int has a limit on how large an integer it can store. This limit can be circumvented by representing an integer as an array of digits. Write an interactive program that adds two integers of up to 50 digits each.

  Write down java console application to add new student

Write down java console application presents the following menu. Add new student and scores in Biology, Physics and chemistry Search for a given student.

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