(Reusability using inheritance)
The postage for ordinary post is Rs. 2.00 for the first 15 grams and Rs. 1.00 for each additional 10 grams. Write a C++ program to calculate the charge of postage for a post weighting N grams. Read the weights of N packets and display the total amount of postage using multiple inheritance.
* Base class-1: Member variables are name, source and destination.
* Base class-2: Member variables are no. of packets and weight.
* Derived class: Member functions display(), displays the name, source, destination, total weight and total amount.
http://prnt.sc/130efe5
Do you agree to the assertion that, the Fourth Industrial Revolution (4IR) technologies will take over almost all jobs in the world? Your position should be justified with plausible reasons.
write a function that takes two int arguments and returns reference of the odd number out of two.If both the arguments are odd,then the reference of the smaller one is returned in c++
A program that will prompt the user to input 3 numbers and display the sum of 3 input numbers.(Both pseudocode and flowchart)
Reusability using inheritance
Design a pay roll system to find the employee total salary using single inheritance. The base class employee consisting of data members such as emp_number and emp_name. The derived class salary consisting of data members such as Basic_pay, HRA, DA, PF, Net_pay.Runtime Input :
1200
Raja
12500
1200
1500
1800
Develop a C++ program to negate the complex number by using unary minus operator overloading
Runtime input
2
-3
Conventionally it was thought that 1 year in a dog's age equals 7 years in human age. A fairly new concept in aging studies claims that chemical modifications to a person's DNA over a lifetime essentially serve as an "epigenetic clock." This tracks an individual's "biological age". The “epigenetic clock” also applies to dogs. The most precise method to convert a dog’s age to human years uses the empirical equation that the researchers in aging studies discovered, which is 16 x ln(dog’s age) +31 = human age, (that is the natural logarithm of the dog’s real age, multiplied by 16, with 31 added to the total.) Write two overloaded functions to calculate a dog’s age in human years, one using the conventional method (simply multiplying the dog’s age in years by 7) and the other using the empirical equation proposed by the researchers in aging studies (16 x ln(dog’s age) + 31 = human age).
Write a program that will calculate a student’s year marks for all his subjects. The program must read the subject code, the assignment marks for two assignments and the percentage that each assignment contributes towards the year mark, for each subject that the student is registered for. COS1511 30 66 70 49 COS1512 25 76 75 67 COS1521 10 58 90 62 COS1501 50 62 50 57 INF1501 40 82 60 78 INF1511 20 24 80 55 The first field in each line represents the subject code, followed by the percentage that assignment 1 contributes towards the year mark and the student’s mark (a percentage) for assignment 1. Then follow the percentage that assignment 2 contributes towards the year mark and the student’s mark for assignment 2. Your program must read the file line by line, calculate the student’s year mark for the subject as a percentage and write the subject code and the year mark to an output file yearmark.dat.
9. Which of these keywords is used to by the calling method to guard against the exception that is thrown by called method? Please select the correct option "A, B, C, D, or E"
A. try
B. throw
C. throws
D. catch
E. finally