subject

Create a class Car, which contains Three data members i. e. carName (of string type), ignition (of bool type), and currentSpeed (of integer type) ď‚· A no-argument constructor to initialize all data members with default values
ď‚· A parameterized constructor to initialize all data members with user-defined values
ď‚· Three setter functions to set values for all data members individually
ď‚· Three getter function to get value of all data members individually
ď‚· A member function setSpeed( ) // takes integer argument for setting speed
Derive a class named Convertible that contains
ď‚· A data member top (of Boolean type)
 A no-argument constructor to assign default value as “false” to top
ď‚· A four argument constructor to assign values to all data-members i. e. carName, ignition, currentSpeed and top.
ď‚· A setter to set the top data member up
ď‚· A function named show() that displays all data member values of invoking object
Write a main() function that instantiates objects of Convertible class and test the functionality of all its member functions.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:30
Write code using c . (take input from user) calculate the size of a given file in kbs. in this task you will complete the function with the following prototype: float get_file_size(char * filename); the function takes the file name (address to the start of a null terminated character array) as input. the function should then open the file and find the number of bytes it contains till eof. the number of bytes divided by 1024 will give the size in kbs. if the file cannot be opened the function should return -1.
Answers: 2
question
Computers and Technology, 22.06.2019 05:10
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
You know the right answer?
Create a class Car, which contains Three data members i. e. carName (of string type), ignition (of b...
Questions
question
Mathematics, 17.12.2019 05:31