Write a program to calculate the total expenses. Quantity and price per item are input by the user and discount of 10% is offered if the expense is more than 7000.
#include<iostream.h>#include<conio.h>void main(){int totalexp, qty, price, discount;cout<<"Enter quantity:";cin>>qty;cout<<"Enter price:";cin>>price;totalexp=qty*price;if(totalexp>7000){discount=(totalexp*0.1);totalexp=totalexp-discount;}cout<<"Total Expense is Rs. "<<totalexp;getch();}
thanx
ReplyDeletecan u convert this program in java
ReplyDeletepublic class Expenses
ReplyDelete{
public static void main(String args[])
{
int qty,price;
double discount,totalexp;
qty=Integer.parseInt(args[0]);
price=Integer.parseInt(args[1]);
totalexp=qty*price;
if(totalexp>7000)
{
discount=(totalexp*0.1);
totalexp=totalexp-discount;
}
System.out.println("Total Expense is Rs. "+totalexp);
}
}
can u convert this program when 1 or more items are there
DeleteYou can Compile and Run this program
ReplyDeletejavac Expenses.java
Java Expenses 5 200
Total Expense is Rs. 1000.0
why we multiply 0.1
ReplyDeleteCan u convert this program in c#
ReplyDeleteCan you please re-write this program using dialog box (j pane) GUI based
ReplyDeletecan u write this program in class
ReplyDeletewrite a program to prepare bill of employee and store name , product, quantiny and stock amount. calculate the 10 % discount if stock amount is over 50 in qbasic.i need in qbasic. plz reply fast.
ReplyDeletecan u convert into a c language
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCan u convert it into python
ReplyDeleteCan u convert in this program in class in c++
ReplyDeleteDesign a class Market to calculate the total expenses. The quantity and price per item are input by the user and discount of 10% is offered if the expense is more than 5000.
ReplyDeletewrite a program for car rental. select a car type from 3 car types(day rates A$50,B$70 & C$100), fix bond of $200, daily insurance of $20/day and Total cost.
ReplyDelete