Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a simple C++ Win32 console application that creates two classes. The first class will implement a resistor with private data members of; resistance and

Write a simple C++ Win32 console application that creates two classes. The first class will implement a resistor with private data members of; resistance and current; provide a constructor that will initialize these members; and provide public methods ChangeResistance(), BandResistance(), ChangeCurrent(), ResistanceVal(), CurrentVal(), and VoltageVal(). The class can implement other members/methods as needed. This Class is used to store the resistance and current, changing these values will be done by passing an argument to the method. In other words, values for resistance and current will be entered in main and then passed to the class method to become private. Reading these values can only be done by a method of the class. Method descriptions: ChangeResistance(passed parameter) Is a method that will change the resistance with the parameter that is passed. BandResistance(passed parameters) Will change the resistance based on 3 color strings that are passed as parameters (Like Lab 5 only no tolerance). ChangeCurrent(passed parameter) Is a method that will change the current with the parameter that is passed. ResistanceVal(void), CurrentVal(void),VoltageVal(void) Each will return the corresponding variable or calculation. The second class will implement power and be a derived class from the first class. This class will provide a method to return the power. The Main routine of this program will contain a variable of only the second class. A menu system will be used to enter values and call corresponding methods (Resistance, Band Colors, Current, and Exit). Upon changing a value all variables will be printed (Resistance, Voltage, Current, and Power). The program will loop until the exit menu item is selected.

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

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions