a class of teacher that contains the attribute teacher name,age and address. it also contain member function to input and display. write another class of writer that contains the attribute name,address and no of book witten byhim.it also contain member function to input and show.
Write a program that demonstrate the use of constructor with default arguments for the following problem. Define a class Person with data member as name and age. Create three objects with no argument, one argument name and two argument name and age. You are not allowed to create more than one constructor.
Write a C++ program to find which date is greater than given date (Assume the 2 dates in one
single year only, consider leap year also as an input).
a. Define a class called day with members as date, month and year.
b. Define a parameterized constructor to initialize the dates.
c. Overload > operator using member function to check if date1 > date2.
d. Write a show_date function to show the date in dd : mm : yyyy format.
Write a function named "sum_from_to" that takes two integer arguments, call them "first" and "last", and returns as its value the sum of all the integers between first and last inclusive. Thus, for example:
cout << sum_from_to(4,7) << endl; //will print 22 because 4+5+6+7 = 22
cout << sum_from_to(-3,1) << endl; //will print -5 'cause (-3)+(-2)+(-1)+0 +1 = -5
cout << sum_from_to(7,9) << endl; //will print 22 because 7+8+9 = 24
cout << sum_from_to(9,9) << endl; //will print 9
A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is divisible only by 1 and n. For example, the integers 17 and 29 are prime, but 1 and 38 are not prime. Write a function named "is_prime" that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise. Thus, for example:
cout << is_prime(19) << endl; // will print 1
cout << is_prime(1) << endl; // will print 0
cout << is_prime(51) << endl; // will print 0
cout << is_prime(-13) << endl; // will print 0
Write a c++ program that uses a simple parametrized constructor to find whether the number entered by the user is Even, Odd or Zero. Copy the same value in another object using copy constructor and show the result separately in a user-defined function named Display().
Design loan calculator using JSP which accepts Periodof Time (in years) and Principal Loan Amount. Display
the
payment amount for each loan and then list the loan
balance and interest paid for each payment over the
term of the
loan for the following time period and interest rate:
a. 1 to 7 year at 5.35%
b. 8 to 15 year at 5.5%
c. 16 to 30 year at 5.75%
Write MATLAB code to show the result card as shown below. Must ask user to enter the
following fields.
1. Student Name. 2. Reg # 3. Subjects
4. Obtained Marks
Automatically Grading are shown as
Obtained Marks>=80
A
Obtained Marks>=70
B
Obtained Marks>=60
c
Obtained Marks<60
D
A positive integer n is said to be prime (or, "a prime") if and only if n is greater than 1 and is divisible only by 1 and n. For example, the integers 17 and 29 are prime, but 1 and 38 are not prime. Write a function named "is_prime" that takes a positive integer argument and returns as its value the integer 1 if the argument is prime and returns the integer 0 otherwise. Thus, for example:
cout << is_prime(19) << endl; // will print 1
cout << is_prime(1) << endl; // will print 0
cout << is_prime(51) << endl; // will print 0
cout << is_prime(-13) << endl; // will print 0
Two way synchronization can be done with wait blocks or message passing. Which one would you choose and Why?