Overloaded insertion operator to display the Time in the form hr:min:sec. If hours, minutes
and/or seconds is a single digit, the time should be shown as 0x: where x is hours, minutes or
seconds. Example: 02:33:45, 13:05:66, 23:17:09
A chunk of plastic is weighed on a scale and has a mass of 68.29 g. Next, the chunk is submerged in a graduated cylinder with an initial volume of water of 100.0 mL. After the plastic is added, the new volume in the cylinder is 129.5 mL. Find the density of the plastic in g/cm3.
Write a program in C++ to read a positive integer number n from a standard input device and to display the number and digit. For example, n = 5678 Output 5 6 7 8 vertically
Two point charges are placed as follows: charge q1 = -1.50 nC is at y = +6.00 m and charge q2 = +3.20 nC is at the origin. What is the total force (magnitude and direction) exerted by these two charges on a negative point charge q3 = -5.00 nC located at (2.00 m, -4.00 m)?
two markets for substitute goods:
Qs1 = 2P1
QS2=-10+2P2
QD1=20-P1+P2
QD2=40-2P2+P1
FIND THE EQUILIBRIUM PRICE AND QUANTITY OF THE TWO GOODS
: A computer program is tested by 3 independent tests. When there is an error, these tests will
discover it with probabilities 0.2, 0.3 and 0.5, respectively. Suppose that the program contains an
error. What is the probability that it will be found by at least one test.
A diagnostic test has a probability 0.95 of giving a positive result when applied to a person suffering from a certain disease, and a probability0.10 of giving a (false) positive when applied to a non- sufferer. It is estimated that 0.5 % of the population are sufferers. Suppose that the test is now administered to a person about whom we have no relevant information relating to the disease (apart from the fact that he/she comes from this population). Calculate the following probabilities:
(a) that the test result will be positive.
(b) that, given a positive result, the person is a sufferer.
(c) that, given a negative result, the person is a non-sufferer.
The computers of six faculty members in a certain department are to be replaced. Two of the faculty members have selected laptop machines and the other four have chosen desktop machines. Suppose that only two of the setups can be done on a particular day, and the two computers to be set up are randomly selected from the six (implying 15 equally likely outcomes; if the computers are numbered 1, 2,…, 6, then one outcome consists of computers 1 and 2, another consists of computers 1 and 3, and so on).
a. What is the probability that both selected setups are for laptop computers?
b. What is the probability that both selected setups are desktop machines?
c. What is the probability that at least one selected setup is for a desktop computer?
d. What is the probability that at least one computer of each type is chosen for setup?
Write a program to implement the Date class which has three data members named day, month and year.
1. Provide a constructor, which takes arguments (you may set values of data members to 0).
2. Write getter and setter functions (input and show functions) for the Date class.
3. Also write a member function void CompareDates(Date d1, Date d2) which tells which date comes first.
Example output:
13/11/2009 comes before 20/12/2009
Create a class named ‘Rectangle’, Triangle and Square.
Rectangle class:
Data Members: length, width and area
Functions:input() ,area_Calculator()
Square class:
Data Members: length,area
Functions :input() , area_Calculator()
Triangle class:
Data Members: base,hieght,area
Functions :Input() , area_Calculator()
Compare their areas in a friend function and tell which shape has greatest area.
Area of rectangle: length*width;
Area of triangle: ½(base*height);
Area of square: (length)2