# Question: Can i get the code of this as well and the psuedo design with switch statement no boolean thank you…

Can i get the code of this as well and the psuedo design with switch statement no boolean thank you

rano Programming Project (Fall 2018) Due Date: CSC-117 java programming language Write a program to calculate the area of four shapes (Rectangle, triangle, circle and square). The program to present the user with a menu where one of the shapes can be selected. Based on the selection made, the user enters the proper input, the program validates the input (i.e all entries must be greater than zero) Once the input is entered and validated, the intended area is calculated and the entered information along with the area are displayed. Area of the Square Side A2 Area of the Rectangle Length Width Area of the Triangle h Base Hight Area of the Circle PI RA2 You MUST apply the following to your program: 1) An if else or a switch statement to present the selection menu 2) A loop to validate the input. 3) Formatted output. 4) Full documentation 5) The program is to rerun based on the user’s request (a loop to restart). Hand in the following: a) b) A detailed and precise design in pseudocode. (design must match 1 to 1 with the source code) A FULLY documented source code. Screenshots of all output scenarios. c)

Hey,

Below is the pseudocode to your question

Don't use plagiarized sources. Get Your Custom Essay on
Question: Can i get the code of this as well and the psuedo design with switch statement no boolean thank you…
Get an essay WRITTEN FOR YOU, Plagiarism free, and by an EXPERT!
2. Continue if user enters less than 1 or greater than 4
3. If choice is 1 then ask for side and print area=side*side
4. Else If choice is 2 then ask for side1 nd side2 and print area=side1*side2
5. If choice is 3 then ask for base and height and print area=0.5*base*height
6. If choice is 4 then ask for radius and print area=pi*r*r
7. Ask user if he wants to continue
8. If continue then make flag=0 else flag=1

Below is the code to your question

import java.util.Scanner;

import java.lang.Math.*;

public class SHAPES

{

public static void main(String[] args)

{

int choice=0,flag=0;

Scanner sc = new Scanner(System.in);

while(flag==0)

{

choice=0;

while(choice<=0||choice>4)

{

System.out.printf(“Press 1 for SquarenPress 2 for RectanglenPress 3 for TrianglenPress 4 for Circle”);

choice=sc.nextInt();

}

if(choice==1)

{

System.out.println(“Enter side: “);

double side=sc.nextDouble();

System.out.printf(“The area the square is %.2fn”,side*side);

}

else if(choice==2)

{

System.out.println(“Enter side1: “);

double side1=sc.nextDouble();

System.out.println(“Enter side2: “);

double side2=sc.nextDouble();

System.out.printf(“The area of the rectangle is %.2fn”,side1*side2);

}

else if(choice==3)

{

System.out.println(“Enter base: “);

double side1=sc.nextDouble();

System.out.println(“Enter height: “);

double side2=sc.nextDouble();

System.out.printf(“The area of the triangle is %.2fn”,0.5*side1*side2);

}

else

{

double r=sc.nextDouble();

System.out.printf(“The area the circle is %.2fn”,Math.PI*r*r);

}

System.out.println(“Press 1 to exit”);

flag=sc.nextInt();

}

}

}

Order NOW For a 10% Discount!
Pages (550 words)
Approximate price: -

Why Work with Us

Top Quality and Well-Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.

Free Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.

Prompt Delivery and 100% Money-Back-Guarantee

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

## Calculate the price of your order

Total price:
\$0.00

How it works?

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

## Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.