Page 124 - Modular_V2.0_C++_Flikpbook
P. 124

getch();
                  }

                  Project 5                                                                     21 st  Century   #Critical Thinking
                                                                                                    Skills
                  Write a program in C++ to display the conversion of Meters to Kilometers, Centimeters to meters
                  and Liters to Millimeters. The user can choose to perform one conversion at a time through a
                  menu type selection.
                  Project 6                                                                     21 st  Century   #Critical Thinking
                                                                                                   Skills
                  Write the following C++ code and see the output:

                  #include<iostream.h>
                  #include<conio.h>
                  void main()
                  {

                      clrscr();
                      int age;
                      cout<< "Enter your age: ";
                      cin>> age;
                      if(age < 13)

                      {
                          cout<< "You are a Child.";
                      }
                      else if(age >= 13 && age <= 19)
                      {

                          cout<< "You are a Teenager.";
                      }
                      else if(age >= 20 && age <= 59)
                      {
                          cout<< "You are an Adult.";

                      }
                      else if(age >= 60)
                      {
                          cout<< "You are a Senior Citizen.";
                      }

                      else
                      {
                          cout<< "Invalid input.";
                      }
                      getch();

                  }

                   122
                          Touchpad MODULAR (Ver. 2.0)
   119   120   121   122   123   124   125   126   127   128   129