Preview

aneeb iqbal

Good Essays
Open Document
Open Document
538 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
aneeb iqbal
Object Oriented Programming Lab

O b j e c t

Lab 03

O r i e n t e d

P r o g r a m m i n g

Lab 03

L a b
Marks 10

Instructions
Work on this lab individually. You can use your books, notes, handouts etc. but you are not allowed to borrow anything from your peer student.
Marking Criteria
Show your work to the instructor before leaving the lab to get some or full credit.
Submission
Paste the solution(s) folder of the problems (source code .cpp files only) labeled with your complete roll number in OOPM – Lab3 folder till 04:00 PM. This folder is available at \\printsrv\Teacher Data\Hassan Khan\OOP\Students
What you have to do
Program the following tasks in your Microsoft C++ compiler and then compile and execute them. The name of your files will be according to the task given in this lab.
Task 1
Create class Cylinder which will have
• an instance variable to store the radius of cylinder.
• an instance variable height indicating the height of cylinder.
• Provide a method modifyRadius(double) that sets the radius to a new value.
• Provide a method modifyHeight(double) that sets the height to a new value.
• Provide a method calculateArea() to calculate the area of a cylinder. Finally this method will return the area of cylinder.
• Provide a method calculateVoulme() to calculate the volume of a cylinder. Finally this method will return the volume of cylinder. Write a main() to run your program that will create two objects of Cylinder, cylinder1 and cylinder2, with radius of 2.00 and 3.00 meters respectively. Set height to 5 meter, then calculate the area, volume and print their values. Also make calls to all the member functions of the class to test their functionality from main().
Also do check the functionality of default copy constructor.
Task 2
Write a class named Car that has the following member variables:




yearModel: An int that holds the car’s year model. make: A pointer to char that holds the make of the car.

You May Also Find These Documents Helpful

  • Satisfactory Essays

    1 Draw a cross on a piece of paper and put it underneath a 100 cm3 measuring cylinder, or use the cross from part 2, so it can be seen when looking down the cylinder.…

    • 735 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Nt1330 Unit 6 Lab Report

    • 1088 Words
    • 5 Pages

    This lab requires that you answer questions, shoot screen shots, and perform other activities that you will document in a worksheet named for the lab. You will find the worksheet on Moodle. It is recommended that you use a USB flash drive to store your worksheets so you can submit them to your instructor for review. As you perform the exercises in each lab, open the…

    • 1088 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    70-410 R2 Lab 1

    • 1445 Words
    • 7 Pages

    Each lab in this manual requires that you answer questions, create screen shots, and perform other activities that you will document in a worksheet named for the lab, such as Lab 01 worksheet.docx. It is recommended that you use a USB flash drive to store your worksheets, so you can submit them to your instructor for review. As you perform the exercises in each lab, open the appropriate worksheet file, fill in the required information, and save the file to your flash drive.…

    • 1445 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    NT2670 Lab1 2

    • 1472 Words
    • 7 Pages

    Each lab in this manual requires that you answer questions, save images of your screen, or perform other activities that you document in a worksheet named for the lab, such as lab1_2_worksheet. Your instructor will provide you with the worksheet files that you must complete for each lab. As you perform the exercises in each lab, open the appropriate worksheet file using WordPad, fill in the required information, and save the file to your…

    • 1472 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    Each lab in this manual requires that you answer questions, save images of your screen, or perform other activities that you document in a worksheet named for the lab and task, such as lab3_1_ worksheet. Your instructor provided you with lab worksheets. As you perform the tasks and exercises in each lab, open the appropriate worksheet file using WordPad, fill in the required information, and save the file to your computer’s Student##\Documents folder. Print a copy for your instructor.…

    • 1638 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Each lab in this manual requires that you answer questions, create screen shots, and perform other activities that you will document in a worksheet named for the lab, such as Lab01_worksheet.docx. It is recommended that you use a USB flash drive to store your worksheets, so you can submit them to your instructor for review. As you perform the exercises in each lab, open the appropriate worksheet file, fill in the required information, and save the file to your flash drive.…

    • 1996 Words
    • 8 Pages
    Satisfactory Essays
  • Good Essays

    Gainless Steel Lab

    • 685 Words
    • 3 Pages

    1. Measure the cylinder that your teacher gave you using a triple balance scale and round to the nearest tenths place.…

    • 685 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Data Measurement

    • 501 Words
    • 4 Pages

    Determine the volume of the following objects. If you cannot do so by measuring the dimensions, use…

    • 501 Words
    • 4 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab 2 Instructions

    • 389 Words
    • 2 Pages

    4. Open the Lab 2: Assessment Worksheet Assignment. USE THIS DOCUMENT TO RECORD YOUR LAB ANSWERS.…

    • 389 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Ilab Instructions

    • 2258 Words
    • 10 Pages

    Download the Lab1C_Questions.docx from your course “DocSharing” and save the file to your local drive.…

    • 2258 Words
    • 10 Pages
    Satisfactory Essays
  • Good Essays

    Basic Lab Measurements

    • 465 Words
    • 2 Pages

    Carefully transfer the water from the graduated cylinder to the burette and record the volume of the burette.…

    • 465 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    It Cousre Work Answers

    • 1260 Words
    • 6 Pages

    Each lab in this manual requires that you answer questions, save images of your screen, or perform other activities that you document in a worksheet named for the lab, such as lab1_2_worksheet. Your instructor will provide you with the worksheet files that you must complete for each lab. As you perform the exercises in each lab, open the appropriate worksheet file using WordPad, fill in the required information, and save the file to your computer’s Student##\Documents folder. Print and turn in a copy of the file for your instructor.…

    • 1260 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    * Pour the water from the test tube into the 25 mL graduated Cylinder. Record the volume of the water below. Empty the graduated cylinder.…

    • 839 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    ddfdwqdewqrfqwrf

    • 1724 Words
    • 7 Pages

    Each lab in this manual requires that you answer questions, take screen shots, and perform other activities that you will document in a worksheet named for the lab, such as Lab12_worksheet.docx. It is recommended that you use a USB flash drive to store your worksheets, so you can submit them to your instructor for review. As you perform the exercises in each lab, open the appropriate worksheet file, fill in the required information, and save the file to your flash drive.…

    • 1724 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Paper Towel Experiment

    • 296 Words
    • 2 Pages

    6. Pour water in pan back into the graduated cylinder and calculate the amount of water the square of paper held.…

    • 296 Words
    • 2 Pages
    Satisfactory Essays