Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Compute and display the output of the Area (A) of a rectangle, based on


inputted value for length (L) and the width (W).


Formula: A = L * W



Flowchart to C++ code

H=11.3cm is the height of the triangle.

B=8.7cm is the base of the triangle.

Create a class for the above triangle.

1.Create one default constructor.

2.Create four parameterized constructors .They would look

like-

·Constructor_name(double, double)

.Constructor_name(double, int)

.Constructor_name(int, double)

·Constructor_name(int, int)

3.Create one copy constructor.

4.Create a function which would show the area of the triangle.

5.Create a destructor.

Call each of the functions from main functions. Call Constructor

name(do.

int) using pass by value and Constructor name(int, double) by

pass by

reference.


Real life example of static data member in class


: Write a program to perform basic to class conversion [Such as there is a class named: “conversion” with data members: feet and inches (both int)] Convert basic type(int) height in terms of total number of inches into equivalent feet and inches (class type) and display output on screen.


Write a menu driven C++ program that enables users to buy coffee from a shop. The program should propmt the user to enter choice of coffee they want and then comoute the total cost. The program should also allow users to repeated select options without exiting unless if the user has chosen a no option. 


Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. 

Ex: If the input is: 

5 10 5 3 21 2

the output is:

2 and 3

You can assume that the list of integers will have at least 2 values.

To achieve the above, first read the integers into a vector.

Hint: Make sure to initialize the second smallest and smallest integers properly.



Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. That list is followed by two more integers representing lower and upper bounds of a range. Your program should output all integers from the list that are within that range (inclusive of the bounds). For coding simplicity, follow each output integer by a comma, even the last one. The output ends with a newline.

Ex: If the input is:

5 25 51 0 200 33
0 50

then the output is:

25,0,33,

(the bounds are 0-50, so 51 and 200 are out of range and thus not output). 

To achieve the above, first read the list of integers into a vector.


Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words.

Ex: If the input is: 

5 hey hi Mark hi mark

the output is: 

hey - 1
hi - 2
Mark - 1
hi - 2
mark - 1

Hint: Use two vectors, one vector for the strings and one vector for the frequencies.


Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. 

Ex: If the input is: 

5 50 60 140 200 75 100

the output is:

50,60,75,

The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75.

For coding simplicity, follow every output value by a comma, including the last one. 

Such functionality is common on sites like Amazon, where a user can filter results.


Imagine a class of TV with data members Name, brand, model and price. Give appropriate data types of data members. Write the following functions in this use case scenario.

·      Display function for all members and write this function outside of the class

·      Add three of constructors as discussed in class

·      Add destructor

·      Write setter and getter

·      Create object and call the function accordingly

·      All inputs should be user runtime inputs


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS