0% found this document useful (0 votes)
24 views1 page

Java Cloud Storage Billing Calculator

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Java Cloud Storage Billing Calculator

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import [Link].

Scanner;
public class Cloudstorage
{ // class opening bracket
int acno;
int space;
double bill;// variable decalartion

void accept()// accepting input from user


{
Scanner sc = new Scanner([Link]);// creating a scanner object
[Link]("Enter your Account Number:");
acno = [Link]();
[Link]("Enter your storage space:");
space = [Link]();
}

void calculate() // calculating theuser input


{
if(space<=15)
{
bill = space*15;
}
else if(space<=30)
{
bill =(15*15)+(space-15)*13;
}
else
{
bill = (15*15)+(15*13)+(space-30)*11;
}
}

void display()
{
[Link]("Account Number:"+acno);
[Link]("Storage Space:"+space);
[Link]("Bill to be paid:" +bill);
}
public static void main(String args[])
{
Cloudstorage o = new Cloudstorage();
o. accept();
[Link]();
[Link]();
}// main
} // class

You might also like