4. A person is going on a motorway and at one point he can see roads going in three different directions. Based on the destination, he will move either toward left, right or straight. Write a C++ program that guides the traveler based on the following directions:
• If destination is Lahore, then turn left.
• If destination in Islamabad or Murree, then turn right. • Otherwise move straight.
3. Write a program that asks the user to enter a value for x and then displays the value of the following polynomial 2x^5+3x^4-x^3-2x^2+7x-6.
3. Write a program that asks the user to enter a value for x and then displays the value of the following polynomial 2x^5+3x^4-x^3-2x^2+7x-
Write a program in c++ to input your age in years.the program will convert the age in months days,hours, minutes and seconds and then print all these values on screen
Write a program to calculate total cost of apples.the number of apples and cost per apples is entered by the user
Create a class 'student'with three data member which are name, age and address. The constructor of the class assign default value to name as'unknow', age'0' and address as 'notavailable'. It has two functions with the same name 'setinfo'. First function has two parameter for name age and assigns the same where as the second function takes has three parameter which are assigned to name, age and address respectively. Print the same name age and address of 10 students. Hint- use array of object
5. twos ComplementBinaryToDecimal function This function takes a static array and bit pattern length as its arguments. The function must return the decimal (integer) value computed from the two's complement binary representation given in the array argument in the given bit pattern length. Assume the array is populated with binary bits in the given pattern length and that it is a two's complement representation .
3. computeTwos ComplementBinary function :This function takes a static array , bit pattern length, and an integer number as its arguments . The function must populate the array with the two's complement binary representation of the integer number argument in the given bit pattern length. Assume the all the arguments are valid 4. binaryAddition function This function takes two static arrays, bit pattern length, and a third static array as its arguments . The function must populate the third array with the binary sum of the first two arrays in the given bit pattern lengthAssume the first two arrays are populated with binary bits in the given bit pattern length Moreover assume that all the arguments are valid.
write a programe that reads number from a file named "data.txt" and tell wheather all number in that file are unique or not ? i
by CodeChum Admin
It's quite nostalgic to remember of our elementary days where we used to line up in one straight line first thing in the morning for the daily flag ceremony, right?
Well, since I’m getting so sentimental, let’s make five randomly inputted characters fall in line using code, shall we?
Input
Five lines containing a character on each.
a
b
c
d
e