PS 8

  1. Write a car class; it should have two variables, a bool on and a string noise. It should have default constructor which sets on to false and noise to "vroom" and another constructor which sets on to false and sets the noise to whatever you tell it. It should have a method go() which prints the value of noise iff on is true and a second method switch_on() should set on to true. The programme
    #include<cstdlib>
    
    #include "Car.cpp";
    
    using namespace std;
    
    int main()
    {
    
     Car vw;
     Car audi("Roorr");
    
     vw.switch_on();
    
     vw.go();
     audi.go();
    
    }
    
    
    should produce the output vroom.
Submit the program you wrote and send it to tcd.ma1262@gmail.com both by cut and pasting it and as an attachment. Say if it compiles and put PS8 and your tutorial time in the subject line.