Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

minutes and hours, but has a float for seconds. In CHt, this idea is expanded to classes. No only does a class group data types

image text in transcribed
minutes and hours, but has a float for seconds. In CHt, this idea is expanded to classes. No only does a class group data types together.,it also combines functions that go with them. Checkpoint 1: Create a struct watch time that will store time. The hours and minutes should be stored as an integer, and the seconds as a float. The time can be assigned using the (dot) operator and accessing each variable individually. Write a function that will take in the type watch time and display it. Example 1 The time is 11 :12:11.12 Below should be new classes. Each class needs to have a class header h) file for all the decelarations and a class source (" cpp) file for the function definitions. This is an important part for creating larger projects where organization and code reusability is key. We will create several classes, each file must be included in your project Checkpoint 2: Create a class called Point. This class needs two floats to store an (x.y) coordinate. The class should have a Constructor, Destructor, Set XY, Set_X, Set_Y, Get X, an Get Y Checkpoint 3: Extend the class Point to include a z variable. Write a display function that wil write the (x.y,z) coordinate, it should not end the line. Example 3: A point should be displayed as (4, 2). Checkpoint 4: Add copy constructors to the class Point to take in the initial point position. Point (int x, int y, int 2); Checkpoint 5: Create a class called Line that is formed by 2 points. You should be able to assign each point with either (x.y,z) or by sending in a point. Add functions to calculate the distance between the two points and to display the line in the format (xl,ylzl)-(x2y2,2 (You can use Point's display function in this process.) Example S (4 2, 12)(6, 0), and its length is 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the accounting equation for a proprietary fund?

Answered: 1 week ago

Question

Does each interface require discrete inputs and outputs?

Answered: 1 week ago

Question

Discuss the states of accounting

Answered: 1 week ago

Question

Presentations Approaches to Conveying Information

Answered: 1 week ago