:cry:
I have written this in TCLite v1.x (Successful!) but when I ran it on BloodShed DevC++ v4.9.9.1 (Latest from Blood) it won't work!.. arrgg.. I need this functionalities.. ;-(.. for educational
I typed exactly these...
#include <iostream.h>
#include <conio.h>
void main ()
{ int mark;
int sum;
char cont;
int student;
char gender;
int age;
do {
do {cout<<"\nEnter Number of Student: ";
cin>>student;
if (student<1||student>9000)
{cout<< "Invalid!";}} while (student <1||mark>9000);
do {cout<<"\nEnter Age: ";
cin>>age;
if (age<15||age>60)
{cout<< "Invalid!";}} while (age<15||age>60);
do
{cout<<"\nEnter Gender: ";
cin>>gender;
if (gender!='m'&&gender!='M' && gender!='f'&&gender!='F')
{ cout<<"Invalid! You're not gay right? Enter Male or Female Only!"; }
} while (gender!='m'&&gender!='M' && gender!='f'&&gender!='F');
do {cout<<"\nEnter Mark: ";
cin>>mark;
if (mark<0||mark>100)
{cout<< "Invalid!";}}while (mark <0||mark>100);
sum=sum+mark;
if (mark>=0&&mark<=40) {cout<< "Grade F";}
else if (mark>=41&&mark<=60) {cout<< "Grade C";}
else if (mark>=61&&mark<=80) {cout<< "Grade B";}
else if (mark>=81&&mark<=100) {cout<< "Grade A";}
cout<<"\n\n";
cout<<" Displaying Information";
cout<<"\n----------------------";
cout<<"\n";
cout<<"\nYour Number of Student:"<<student;
cout<<"\nYour Student Age:"<<age;
cout<<"\nYour Student Gender:"<<gender;
cout<<"\nYour Student Mark:\n "<<mark;
do {cout<<"Do you wish to continue?";
cin>>cont;
if (cont!='Y'&&cont!='N')
{ cout<<"Invalid.Please Try Again"; }
} while (cont!='Y'&&cont!='N' && cont!='y'&&cont!='n');
} while (cont=='Y'&&cont=='y');
}
----
#include <iostream.h>
#include <conio.h>
void main() {
// clrscr();
int choice;
float num1,num2,sum;
cout << "[1] Addition\n";
cout << "[2] Subtraction\n";
cout << "[3] Division\n";
cout << "[4] Multiplication\n";
cout << "\nEnter choice: ";
cin >> choice;
cout << "\n\n\n";
switch (choice){
case 1: //addition
cout << "Enter number 1: ";
cin >> num1;
cout << "Enter number 2: ";
cin >> num2;
sum = num1 + num2;
cout << "\nThe sum of addition is: " << sum;
break;
case 2: //subtraction
cout << "Enter number 1: ";
cin >> num1;
cout << "Enter number 2: ";
cin >> num2;
sum = num1 - num2;
cout << "\nThe difference is: " << sum;
break;
case 3: //division
cout << "Enter number 1: ";
cin >> num1;
cout << "Enter number 2: ";
cin >> num2;
sum = num1 / num2;
cout << "\nThe sum of division is: " << sum;
break;
case 4: //multiplication
cout << "Enter number 1: ";
cin >> num1;
cout << "Enter number 2: ";
cin >> num2;
sum = num1 * num2;
cout << "\nThe sum of multiplication is: " << sum;
break;
}
getch();
}
---------
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
cout<<"\n ---------------------------------------------------------- ";
cout<<"\n | Product Number | Price |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 1 | 10 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 2 | 30 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 3 | 50 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 4 | 90 |";
cout<<"\n ---------------------------------------------------------- ";
char pronum;
int qty;
float sum,sum1,sum2,sum3,sum4,sum5,sum6,sum7,sum8,sum9,sum10;
float sum11,sum12,sum13,sum14,sum15,sum16,sum17,sum18,sum19,sum20;
float sum21,sum22,sum23,sum24,sum25,sum26,sum27,sum28,sum29,sum30;
float sum31,sum32,sum33,sum34,sum35,sum36,sum37,sum38,sum39,sum40;
float sum41,sum42,sum43,sum44,sum45,sum46,sum47,sum48,sum49,sum50;
float sum51;
cout<<"\n\nPlease key in the product number :";
cin>>pronum;
if(pronum=='1'){
sum=10;
}
if(pronum=='2'){
sum1=30;
}
if(pronum=='3'){
sum2=50;
}
if(pronum=='4'){
sum3=90;
}
cout<<"\n ---------------------------------------------------------- ";
cout<<"\n | QTY Sold | Discount(%) |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | <100 | 10 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 101 to 300 | 30 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | 301 to 600 | 40 |";
cout<<"\n |----------------------------------------------------------|";
cout<<"\n | >600 | 45 |";
cout<<"\n ---------------------------------------------------------- ";
cout<<"\n\nPlease key in the quantity :";
cin>>qty;
if(pronum=='1'){
if(qty<=100){
sum4=sum*0.1;
sum5=sum-sum4;
sum6=sum5*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum4;
cout<<"\nNet Price :"<<sum6;
}
if(qty>100 && qty<=300){
sum7=sum*0.3;
sum8=sum-sum7;
sum9=sum8*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum7;
cout<<"\nNet Price :"<<sum9;
}
if(qty>=301 && qty<=600){
sum10=sum*0.4;
sum11=sum-sum10;
sum12=sum11*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum10;
cout<<"\nNet Price :"<<sum12;
}
if(qty>600){
sum13=sum*0.45;
sum14=sum-sum13;
sum15=sum14*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum;
cout<<"\nQty Sold :"<<qty;
cout<<"\nDiscount ($) :"<<sum13;
cout<<"\nNet Price :"<<sum15;
}
}
if(pronum=='2'){
if(qty<=100){
sum16=sum1*0.1;
sum17=sum1-sum16;
sum18=sum17*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum1;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum16;
cout<<"\nNet Price :"<<sum18;
}
if(qty>100 && qty<=300){
sum19=sum1*0.3;
sum20=sum1-sum19;
sum21=sum20*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum1;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum19;
cout<<"\nNet Price :"<<sum21;
}
if(qty>=301 && qty<=600){
sum22=sum1*0.4;
sum23=sum1-sum22;
sum24=sum23*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum1;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum22;
cout<<"\nNet Price :"<<sum24;
}
if(qty>600){
sum25=sum1*0.45;
sum26=sum1-sum25;
sum27=sum26*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum1;
cout<<"\nQty Sold :"<<qty;
cout<<"\nDiscount ($) :"<<sum25;
cout<<"\nNet Price :"<<sum27;
}
}
if(pronum=='3'){
if(qty<=100){
sum28=sum2*0.1;
sum29=sum2-sum4;
sum30=sum29*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum2;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum28;
cout<<"\nNet Price :"<<sum30;
}
if(qty>100 && qty<=300){
sum31=sum2*0.3;
sum32=sum2-sum31;
sum33=sum32*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum2;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum31;
cout<<"\nNet Price :"<<sum33;
}
if(qty>=301 && qty<=600){
sum34=sum2*0.4;
sum35=sum2-sum34;
sum36=sum35*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum2;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum34;
cout<<"\nNet Price :"<<sum36;
}
if(qty>600){
sum37=sum2*0.45;
sum38=sum2-sum37;
sum39=sum38*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum2;
cout<<"\nQty Sold :"<<qty;
cout<<"\nDiscount ($) :"<<sum37;
cout<<"\nNet Price :"<<sum39;
}
}
if(pronum=='4'){
if(qty<=100){
sum40=sum3*0.1;
sum41=sum3-sum40;
sum42=sum41*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum3;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum40;
cout<<"\nNet Price :"<<sum42;
}
if(qty>100 && qty<=300){
sum43=sum3*0.3;
sum44=sum3-sum43;
sum45=sum44*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum3;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum43;
cout<<"\nNet Price :"<<sum45;
}
if(qty>=301 && qty<=600){
sum46=sum3*0.4;
sum47=sum3-sum46;
sum48=sum47*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum3;
cout<<"\nQty Sold : "<<qty;
cout<<"\nDiscount ($) :"<<sum46;
cout<<"\nNet Price :"<<sum48;
}
if(qty>600){
sum49=sum3*0.45;
sum50=sum3-sum49;
sum51=sum50*qty;
cout<<"\nProduct Number : "<<pronum;
cout<<"\nPrice :"<<sum3;
cout<<"\nQty Sold :"<<qty;
cout<<"\nDiscount ($) :"<<sum49;
cout<<"\nNet Price :"<<sum51;
}
}
getch();
}
My Question are as follows :-)
1) What possibly wrong could I done with the above codes? in TCLite everything is ok.. aw.. btw, where I can find latest TCLite?? or GUI based TCLite??
2) Is there any good GUI based C++ compilers that can support DOS mode '.exe' ?? (e.g #include <iostream.h>, #include <conio.h> etc etc..... ? coz I am still in educational field ;-) so any other compiler beside TCLite functionalities would be better if they still can run the above code.. in DOS Mode.. and with the written syntaxes ;-) Thanks!... Please I am not a developer so talk simple with me.. besides I just learned computer few months back.. and this semester is my first c++ class ..
3) Help me ok? :cry: :cry: :o