Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an application for the Summerdale COndo Sales office; the probram determin

ID: 3557556 • Letter: W

Question

Write an application for the Summerdale COndo Sales office; the probram determines the price of a condominium. Ask the user to choose 1 for park view, 2 for golf course view, or 3 for lake view. The output is the name of the chosen view as well as the price of the condo. Park view condos are $150,000, condos with golf course views are $170,000, and condos with lake views are $210,000. If the user enters an invalid code, set the price to 0.

b. Add a prompt to the CondoSales application to ask the user to specify a (1) garage or a (2) parking space, but only if the condo view selection is valid. Add $5,000 to the price of any condo with a garage. IF the parking value is invalid, display an appropriate message and assume that the price is for a condo with no garage.

Explanation / Answer

import java.io.*;
import java.util.Scanner;
class CondoSales
{
   public static void main(String[] args)throws Exception
   {
       int view;
       int additionalChoice;
       double price;
       boolean condoSelected=false;
       Scanner in=new Scanner(System.in);
       System.out.println("Select View ");
       System.out.print("1)Park view 2)Golf course view 3)Lake view ");
       view=in.nextInt();
       in.nextLine();
       switch(view){
           case 1:
               condoSelected=true;
               price=150000;
               System.out.println("You Have Selected Park View Price is $"+price);
               break;
           case 2:
               condoSelected=true;
               price=170000;
               System.out.println("You Have Selected Golf Course View Price is $"+price);
               break;
           case 3:
               condoSelected=true;
               price=210000;
               System.out.println("You Have Selected Lake View Price is $"+price);
               break;
           default:
               condoSelected=false;
               price=0;
               System.out.println("Invalid price is $"+price);
       }
       if(condoSelected){
           System.out.println("Eneter Details if Required 1)Garage 2)Parking Space ");
           additionalChoice=in.nextInt();
           if(additionalChoice==1||additionalChoice==2){
           price +=5000;
           System.out.println("Total Cost = $"+price+" ");
           }else{
               System.out.println("Total Cost =$"+price+" ");
           }
          
       }
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote