| 1. |
Question OneWrite a menu driven program with functions to calculate the volume of the given shapes. The volume should be displayed using a separate function.a) Sphere: (pass arguments by value)=b) Cylinder: (pass arguments by reference)=c) Cube: (pass arguments by value)=Question TwoThe table shows the average rainfall and temperature during the past rain season stored in a text file called Weather.txtTownTemperatureRainfall Chingola 23 27Kitwe2427 Ndola 23 26Kabwe2426 Lusaka 22 26Kafue2416 Mazabuka 26 15Monze2612 Choma 27 10Livingstone26102Write a program that reads this information from the text file, stores the values in parallelarrays and prints the information stored in the arrays to the screen. |
|
Answer» Answer:the two ANSWERS are as follows Explanation: Assuming all necessary header files are declared and required integers are given. 1) cout<<"ENTER the option option 1: sphere option 2: cylinder option 3: sphere "; cin>>p; SWITCH(p) { case 1: cout<<" enter radus"; cin>>r; vol= 4/3*(22/7)*r*r*r break; case 2: cout<< "enter height"; cin>>h; vol=(22/7)*r*r*h case 3: cout<<" Enter side "; break; cin>>a vol=pow(a,3) break; case 4: exit (0) ; } 2)please kindly specify the table properly. I'm showing the array part. for(i=0;i<N;i++) { cout< } n will be then no of files(.txt) entries allowed and arr Index will SHOW the file content after taking them in the file system |
|