Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Pa Help po. LRT 2 Ticketing Program in c++

glennier

Recruit
Basic Member
Messages
2
Reaction score
0
Points
16
#include <conio.h>
#include <iostream>
#include <math.h>


using namespace std;

int main ()
{
int Or, Ds, TD, Cs, Ch, Fare= 0;

cout<<" *********************************************************************************"<<endl;
cout<<" * WELCOME TO LRT 2 STATION TICKETING SYSTEM *"<<endl;
cout<<" * *"<<endl;
cout<<" * Please read the instructions below: *"<<endl;
cout<<" * 1. You will need to enter your Current Station(Please see Step #6) *"<<endl;
cout<<" * 2. Enter your destination *"<<endl;
cout<<" * 3. The program will display your Fare for your current Trip *"<<endl;
cout<<" * 4. Enter your Cash *"<<endl;
cout<<" * 5. Check your change *"<<endl;
cout<<" * 6. Here's the lists of LRT 2 Stations *"<<endl;
cout<<" * 1 = SANTOLAN *"<<endl;
cout<<" * 2 = KATIPUNAN *"<<endl;
cout<<" * 3 = ANONAS *"<<endl;
cout<<" * 4 = CUBAO *"<<endl;
cout<<" * 5 = BETTY GO *"<<endl;
cout<<" * 6 = GILMORE *"<<endl;
cout<<" * 7 = J. RUIZ *"<<endl;
cout<<" * 8 = V. MAPA *"<<endl;
cout<<" * 9 = PUREZA *"<<endl;
cout<<" * 10 = LEGARDA *"<<endl;
cout<<" * 11 = C. M. RECTO *"<<endl;
cout<<" * *"<<endl;
cout<<" * HAVE A NICE TRIP IN LRT 2! :) *"<<endl;
cout<<" *********************************************************************************"<<endl;


cout<<"Enter your current station:"<<endl;
cin>>Or;

if (Or == 0) {
cout<<"Oops ! Invalid input"<<endl;

cout<<"Please enter your current station"<<endl;
cin>>Or;
}
else if (Or > 12) {
cout<<" Oops ! Invalid input "<<endl;

cout<<"Please enter your current station:"<<endl;
cin>>Or;
}
else {
Or ='VALID';
}

cout<<"Enter your destination:"<<endl;
cin>>Ds;

if (Ds == 0) {
cout<< "Oops ! invalid input"<<endl;

cout<<"Please enter your destination:"<<endl;
cin>>Ds;
}
else if (Ds > 12) {
cout<<" Oops ! Invalid input "<<endl;

cout<<"Please enter your destination:"<<endl;
cin>>Ds;
}
else {
Ds ='VALID';
}

if (Or < Ds){
TD = Ds - Or;
if (TD <= 3){
cout<<"Your Fare is 15.00 pesos"<<endl;
Fare=15;
}
else if (TD <=6){
cout<<"Your Fare is 20.00 pesos"<<endl;
Fare=20;
}
else if (TD <=10){
cout<<"Your fare is 25.00 pesos"<<endl;
Fare=25;
}
else
cout<<"Invalid "<<endl;
}
else if(Or > Ds){
TD = Or- Ds;
if (TD <= 3){
cout<<"Your Fare is 15.00 pesos"<<endl;
}
else if (TD <=6){
cout<<"Your Fare is 20.00 pesos"<<endl;
}
else if (TD <=10){
cout<<"Your fare is 25.00 pesos"<<endl;
}
else ( TD == 0); {
cout<<"Invalid "<<endl;
}
}



return 0;
getch();
}


Pa tulong po. Paano po gagawin para sa if statements ng fare lumabas? Di po kasi gumagana ang condition na naka Bold Font. Salamat po.
 

Attachments

  • ghhghhghg.png
    ghhghhghg.png
    20.4 KB · Views: 11
Back
Top Bottom