Time point
Create a class called time that has separate int member data for hours, minutes and seconds. One constructor should initialize this data to 0. and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments.
A main program should create two initialized time objects and one that isn’t initialized. Then it should add the two initialized values together, leaving the result in the third time variable.
One form of Ohm’s law is:
E = I×R
where,
- E is applied voltage and is measured in volts(V)
- I is circuit current and is measured in amperes(A)
- R is circuit resistance and is measured in ohms(Ω)
To find E when I = 5mA and R = 2.7KΩ, first convert 5mA to 5×10-3A, 2.7KΩ to 2.7×103Ω and then perform the following calculation
E = 5×10-3A × 2.7×103Ω = 13.5V.
Create Java program that (a) creates a supporting class name, Ohm, which contains one method named, getOhm, that takes two inputs, I (circuit current) and R (circuit resistance), to return the calculation result of E= I×R, (b) create a class with “main” method in it, (c) the main method takes two double values, I and R, (d) create instance of the Ohm class and use it to call the getOhm method with the two double values (I and R) passing to the getOhm method, (e) display returned calculated value in a message box. Be sure to use ampere (A) and ohm (Ω) as units.
NADRA is an organization used to store info of Pakistani citizens, you are a computer programmer and your
Manager given you as task to store the cnic, name, father name, city of birth and date of birth. Write a class
personal info that has five attributes given above. It has a member function to input and a member function to
display the elements. Create another class Passport that inherits personal info class. It has additional attributes
of passport number, date of issue and date of expiry. It also has member functions to input and display its
data members.
Suppose in Islamabad International Airport the plans arrivals and departures are frequent and they are moving with kinetic energy. Your task is to write a class to find the kinetic energy of an airplane coming from the UK having the mass and the velocity known to pilots only. You are a pilot so your captain of the plane has given you the task to write a class to perform the calculation, the function must be defined outside the class. Your task is to provide the mass and velocity as arguments to the function and then display the kinetic energy without returning a value.
Given two arrays A[n] & B[n] containing bit strings representing sets A & B
respectively, write a code fragment to construct bit string representing the set
A⨁B
Write a program using string function that determines if the input word is a
palindrome. A palindrome is a word that produces the same word when it is
reversed.
Enter a word: AHA
Reversed word: AHA
It is a palindrome.
Write a program create a dynamic int array with size mentioned by user.
Ask user to enter a number to search.
apply linear search to find that element.
and in the end deallocate the memory allotted to that array.
Create a 'STRING' class which overloads ‘= = ' operator to compare two STRING objects
Develop a C++ program to Subtract two complex number by overloading - operator using Friend function.
Develop a C++ program to read the value from user and display the address using wild pointer.