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

Use the concepts of inheritance and abstract base class to compute the fencing cost for a

triangular, circular and rectangular region. The fencing cost for 1m is 200/-.


the program should generate two random numbers between 1 and 20 and display the first number. It should then ask the user to enter either H or L for Higher or Lower. The user wins if they entered H and the second number was higher than the first or when they entered L and the second number was lower.


 Write a program to calculate the probability of getting two  six out of 1 thousand times on rolling two dice.


**The teacher gave us a hint by giving a part of the code**

 #include <iostream>

        #include "time.h"

        using namespace std;

 

       int main()

 {

 srand (time(NULL)); // to introduce different random numbers each run

 

         // Complete

 

  } 



The following table shows the latest fees Al Ummah Islamic School.

First Child = RM 500

Second Child Onwards RM 450

a) Function calcFees () will receive the number of children and will calculate and return the fee.

b) Function calcDisc () will receive the fee and return the totalFee. If the users want to pay yearly, they will get a 10 % discount.

c) Function main () will prompt the users to input the number of children they wish to enroll in the school and whether the user want to pay yearly. Then, it will call function calcFees () and calcDisc(). The program will then display the following receipt.

******* AL UMMAH ISLAMIC SCHOOL ****************

NUMBER OF CHILDREN : 3 TOTAL

MONTHLY FEE : RM 1400

TOTAL YEARLY FEE : RM 16800

TOTAL YEARLY FEE (DISCOUNT) : RM 15120

THANK YOU FOR BEING PART OF AL UMMAH ISLAMIC SCHOOL!


1. Write a program using Function Concept to Calculate Perimeter of Circle, Square, Triangle and Rectangle.

i. Function calPerimeterCircle that do not accept arguments and do not return value.

ii. Function calPerimeterSquare that do not accept arguments and return value.

iii. Function calPerimeterTriangle that accept arguments and do not return value.

iv. Function calPerimeterRectangle that accept arguments and return value

2. Please refer the following formula as guidance :

a. Perimeter of Circle = 2 π r : r = radius , use π= 22/7

b. Perimeter of Square = 4a : a = side

c. Perimeter of Triangle = a+b+c : a=side1, b=side2 and c= side3

d. Perimeter of Rectangle = 2 +(l+w) : l=length, w= width 


Encode, compile and run the following programs and do the following:

1. Identify the format of the function used: no return type & no parameter, with return type & no parameter, no return type & with parameter and with return type & with parameter.

2. Identify the format and actual parameters.

3. Identify the function signature

4. Identify parameter if value parameter, reference parameter or constant reference parameter is used.

5. Identify the the scope of variable used.

6. Identify the type of C++ function is used.

*Note see picture: https://drive.google.com/file/d/1BMDWtJ-Rn32VD8JYDIXCIK2I73AL3zOQ/view?usp=sharing


code (1) "Ch6_Largest.cp" "download the code"

https//drive.google.com/file/d/1s_57xZgbzTUs2MExfziY36jkMPp7svYq/view?usp=sharing


use this for example: https://drive.google.com/file/d/18Qsl8Kc1yn6VU-jLIqgFgJgRxJdjqMQc/view?usp=sharing


download them first.


  • Create a C++ program using Fibonacci sequence is a numerical sequence such that after the second element all numbers are equal to the sum of the previous two elements.


1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...


Write a program to calculate and print the first 20 elements of this sequence.  Use a 20-element array to perform this task


Write the code using C++,


(i) Write a function using C++ statements called PrintReport() which takes three float arrays (valuel, value2, value3) and an integer (as the size of the array) as parameters. The method prints the report as given below.

Day Machine A Machine B Machine C Minimum Maximum Total Average

1 15.5 50 35.5 A B 101 33.66

2 25.5 45.5 65 A C 136 45.33

3 27.5 25.5 71 B C 124 41.33

4 60.5 18 74.5 B C 153 51

Note: Should use functions already defined to find mimmum, maximum, total and average.

(j)   Implement the main method of a C++ program to do the followings:

1. Create 3 float arrays with the names machine A, machine B and machine C. The arrays are of size 4.

2.Insert machine A, B and C production to the respective array using the function InputProduction().

3. Print chart of all four (4) days by using the function PrintChart().

4.Print the report using the function PrintReport().


Suppose that you have a mobile phone. Initially the phone has a net value of 35000/-, it has

been used for 0 Hrs and its battery can last for 12 Hrs. Now after every month the phone is

used for 200 hrs on average and its battery backup time decreases by 4%. After every 4%

decrease in battery backup time, the price decreases by 700/-. You need to write a program by

using the concept of operator overloading to calculate the minimum number of months in

which the battery backup time will become less than or equal to 5 hrs and display the net

value and total hours of use and battery backup time of the mobile phone after those months.


Complex numbers can be represented in polar form like M<θ. Where M is the magnitude and

θ is the angle in degrees. Use the concept of operator overloading to write a class in which the

user will enter the magnitudes and angles (in degrees) for two complex numbers. And then

the program will add, subtract, divide or multiply them and display the result in polar form.


LATEST TUTORIALS
APPROVED BY CLIENTS