Project 1


Write a program that checks your speed ticket amount using if and else statements.
User should enter their speed in between 0 and 200. 
When speed over 150, print the following "your ticket is $300.00". 
In between 100 and 150, print "Your ticket is $200.00." 
Anything below 100, print "You are good driver." 
You must validate your speed first before you check the ticket. If the speed is not valid, exit the program.


#include 
using std::cin;
using std::cout;
using std::endl;
int main ()
{
 int speed;
 cout<>speed;
 if (speed < 0)
 {
  cout < 200)
  {
   cout <= 150)
 {
  cout <<"Your Ticket is $300.00\n";
  cout <= 100 && speed < 150)
 {
   cout <= 0)
   cout <>speed;
  return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *