Draw a structured flowchart or write pseudocode describing the logic of the following scenarios:
Move the robot to start from a sitting position in a corner, cross the room, and end up standing outside the room behind the door.
Allow the robot to start from a sitting position in one chair, stand up, cross the room, close the door and, return to the chair, and sit.
Write a programme to demonstrate the Dynamic Memory Allocation with some real-time
example. Also, mention the possible ways of intializing and deallocating memory from dynamically
created objects of the class
What is the difference between Virtual Function and Pure Virtual Function? Is it always mandatory
to implement or define all the pure virtual function of the base class into derived class? Justify your
answer.
Choose data members for class Car to define its properties. Create 2 objects of class Car and
overload the operator ‘greater than’ > to compare both the objects concerning their data members
Create 5 objects of class Product, input its product code, name and quantity and write into the
FILE. Later, display the data of all objects by reading from the FILE
Question :Create a class Account with the following private member variablesData TypeVariable Namechar[]accountNumberdoubleamountchar[]accountHolderUse appropriate Get and Put function to get and display the values for Account classCreate a function calc() to calculate the interest amount as interest_amount=amount*n*r/100, where n is fixed as 5 and r as 3
I used to play Digimon.
Now that I'm a programmer and I have this weird passion of digits, I want to combine them both to create the ultimate program: DigitMon!
This DigitMon program would take an integer input and would output the sum of all the digits of the number. For example, if the input is 243, the output would be 9 because 2 + 4 + 3 = 9. In this case, we say that the DigitMon of 243 is 9.
Instructions:
Input
1. Integer to be processed
Output
Enter·n:·243
DigitMon·of·243·is·9
by CodeChum Admin
Functions that return the value of a base and an exponent is very common so I want to switch it up.
This time, we’re going to try to reverse-engineer these functions and find out the exponent of a certain number based on the value of the result and the base used to get that value.
Instructions:
Input
1. The base
2. The result
Output
Enter·the·base:·2
Enter·the·result:·8
Exponent·=·3
by CodeChum Admin
I love facts. In fact, I dream a lot about facts. Ever since I was a kid, all I ever think of are facts. And that's a fact!
I don't know if that made any sense to you but I think you know about factorials, hmm? In Mathematics, a factorial of a number is the product of all the numbers from 1 up to that number. There is one exception though and that is the factorial of 0 which is 1.
Instructions:
Input
1. Integer to be processed
Output
Enter·n:·3
Factorial·of·3·is·6
by CodeChum Admin
This one’s probably one of the most popular recursion problems in programming. Your task is to create a recursive function that prints out the the first up to the nth number in the Fibonacci sequence by going through the numbers using recursion.
In case you forgot, here is the definition of a Fibonacci sequence:
Instructions:
Input
1. Elements to be printed
Output
Enter·n:·4
1·1·2·3