Define a class called Bookorder
Instance variable :
String title: To store title of the book
double weight : To store weight of the book
double cost : To store cost one book
double totalbooks : To store total numbered of books order
Methods()
Bookorder() : Default constructor to initialize data members to default values void input() : To input all related values
void calculate() : Find total weight and total cost
total weight ; total books * weight;
total cost = total books * weight;
total cost = total books * cost;
Write main method and call all above member method.
Spammers strictly stay away!
Answers
Answered by
6
Answer:
For this in java language :
import java.util.scanner ;
public class Bookorder
{
public static void main (String args[]);
{
string book;
book = sc.nextLine() ;
double weight , cost , totalbooks;
System.out.println("Enter weight ");
weight = sc.nextDouble();
System.out.println(" Enter cost");
cost= sc.nextDouble();
System.out.println(" Enter total books");
totalbooks = sc.nextDouble();
double totalcost, totalweight ;
totalweight ; totalbooks * weight;
totalcost = totalbooks * weight;
System.out.println("Book name ="+book);
System.out.println(" total weight = " + totalweight);
System.out.println("total cost = " + totalcost);
}
}
Explanation:
Hope it helps !!!
Please do mark as BRAINLIEST !!!
Answered by
6
Answer:
hii Ayesha plz follow me
Similar questions