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

  Dangerousmonster which inherits the monster

An interface - DangerousMonster which inherits the Monster interface and has a method called destroy() with void return type.(Note: Just like a class can inherit from another class, an interface can inherit from another interface using the "extends..

  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 program that assigns seats on an airplane

Prepare a program that teaches arithmetic to a young child. The program tests subtraction and addition. Write a program that assigns seats on an airplane.

  Design and implement a small and simple email server

Design and implement a small and simple email server using the concept of web based information system (WBIS).

  Java class to accept a user-s hourly rate of pay

Write a class that accepts a user's hourly rate of pay and the number of hours worked. Display the user's gross pay, the withholding tax (15% of gross pay), and the net pay (gross pay - withholding).

  Alter the prototype form page by javascript function

Alter the prototype form page so that when JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer.

  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.

  Java applet to find how much federal tax we need to pay

Write a java applet to determine how much federal tax we need to pay assuming the tax rate is 12%.  Ask the taxable income.

  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.

  Java program that will add the corresponding elements

Develop a Java program that will add the corresponding elements of two 1-dimensional arrays X and Y to produce the 1-dimensional array Z. Arrays X, Y, Z have the same dimension [M].

  Write a program that reads in a list of numbers from a file

write a program that reads in a list of numbers from a file and adds up all those numbers. You may hard code in the name of the file, allowing the user to input the filename is not required

  A common useful equation

In physics, a common useful equation for finding the position s of a body in linear motion at a given time t, based on its initial position s0, initial velocity v0, and rate of acceleration a, is the following: ??= ??0+??0??+12????2. Write code to de..

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