Write a program which takes a number n as input and prints YAYY if the sum of all digits
except the rightmost digit is equal to the rightmost digit., otherwise print OOPS. (10 marks)
For example: If user enters 2237, it will print YAYY because 2+2+3 is equal to 7.
Whereas, if user enters 3425, it will print OOPS because 3+4+2 is not equal to 5.
Memory constrained embedded systems, IoT devices cannot have liberty to use lots of
memory. You are tasked to store the result of a NUCES-FAST student in one single variable. This can
be done using all bits of that variable in an efficient way. Write a program which prompts user to enter
the following student data and convert all this information to store in a single variable (see sample run).
Use bitwise AND, OR and SHIFT operators. Also use if-else where needed. (20 marks)
Write a program which prompts user to enter
the following student data and convert all this information to store in a single variable (see sample run).
Use bitwise AND, OR and SHIFT operators. Also use if-else where needed. (20 marks)
Alex is found of doing string programs. One day his professor gave him a string based question to solve in a linear time complexity. The program is to change a strit to its diagonal string inter the form of X ( I. e Diagonal from left right and from right left) help him finish it
Write and use utility functions power(x,n) and fact(n), which returns the nth power of x and factorial of n respectively. Write a driver that read and stores input value of x in an integer pointer and finds its exponential. Use as many terms as needed to improve the accuracy of the result.
Write an instance method daysTillXmas that will be placed inside the Date class. The method returns how many days away the Date object is from Christmas, December 25, in the same year. For example, Nov. 22 is 33 days away, Sep. 3 is 113 days away, Dec 25 is 0 days away, and Dec 31 is -6 days away.
Declare a character array cArray of length 10.
• Input the values from user.
• Pass that array to a function copy using a pointer.
• Copy the values of cArray in c1Array using dereferencing.
Write a program that will ask the user to enter a digit character (i.e. ‘0’ or ‘1’ .... or ‘9’). If user
enters a non-digit character then the program should display message to re-enter correct input.
Pak-Wheel requested for a software and asked for the following functionalities.
o Client name, contact, email and transection (only one) are important to keep.
o Client can buy or sell car through pinwheels. The transection details which are
important to keep are date (day), transection type (Buy or Sell) and amount.
Implement the above demand in such a way what if the client is deleted, none of its transection
record will remain. (Use Composition)
4. Later they requested another functionality to be incorporated within the program:
o The car should have its owner detail (client) but if the car is gone or sold, the client
should remain. (Use Aggregation)
Write a program which takes a 9-digit number input from user, converts it into its reverse
and then display one of the following statements