Computer Science, asked by usksss847, 9 months ago

help me please please please please please please please please please please please​

Attachments:

Answers

Answered by Anonymous
2

Explanation:

#A java program

import java.util.*;

class ShowRoom

{

String name;

long mobno;

double cost,dis, amount;

ShowRoom()

{

name="";

mobno=0;

cost=dis=amount=0;

}

void input()

{

Scanner sc=new Scanner (System.in);

System.out.println("enter the customer name,mobile number and cost");

name=sc.nextLine();

mobno=sc.nextLong();

cost=sc.nextDouble();

}

void calculate ()

{

if(cost<=10000)

{

dis=0.05*cost;

amount=cost - dis;

}

else if(cost<=20000)

{

dis=0.10*cost;

amount=cost- dis;

}

else if(cost<=35000)

{

dis=0.15*cost;

amount=cost - dis;

}

else if(cost>35000)

{

dis=20*cost;

amount=cost-dis;

}

}

void display()

{

System.out.println("Customer name:"+name);

System.out.println("mobile number:"+mobno);

System.out.println("amount to be paid after discount:"+amount);

}

public static void main (String args [])

{

ShowRoom obj=new ShowRoom ();

obj.input();

obj.calculate();

obj.display();

}

}

Some additional information:

*the above program is an example of real life problem program.

*java supports constructor.

*a constructor calls itself at the time of object creation (instantion)

Attachments:
Answered by genius1947
0

Answer:

Galileo di Vincenzo Bonaiuti de' Galilei was an Italian astronomer, physicist and engineer, sometimes described as a polymath, from Pisa. Galileo has been called the "father of observational astronomy", the "father of modern physics", the "father of the scientific method", and the "father of modern science". 

Similar questions