Class Assignment (Section D) - CS-104
Class Assignment (Section D) - CS-104
Class Assignment
Instructions:
• You have to answer all the questions.
• Only handwritten submissions are allowed.
• Assignment must be neat and clean. Flowcharts should be properly drawn. Any code
that you write should follow proper indentation/formatting. (Note: Any unformatted
code will carry penalty marks)
• Important: In case two assignments are found to be copied from each other, both of
them, will be equally penalized.
Instructions specific for Question 1: There are 3 types of machines mentioned in this question.
Which machine you have to work on will be decided as per the following rule:
Take the last digit of your roll no and perform a modulo operation of that digit with 3. The
answer will be the S. No. of the machine for which you have to provide the answer
For example: Last digit of Roll No. 23G022 is 2. Performing modulo of 2 with 3 (2%3) gives
2 as answer. So, the student has to draw the flowchart for the machine listed at 2 i.e. Car
Features containing automatic cruise control, dynamic interior lighting, etc.)
Question 1: We use several computation machines in our everyday life like digital watches,
washing machines, thermostats, music player etc. Have you ever imagined how these products
were thought of and created from an idea. Someone must have conceived an idea which was
later modelled by some people using flowcharts, UML diagrams, etc. Engineers might have
utilized these models to develop the working prototype of these machines. As an engineer you
should be able to model the working of engineering products using algorithms and flowcharts.
Write an algorithm and draw a flow chart for modelling the working of any one of the following
machines:
0. Messaging Application such as WhatsApp
1. Social Media Platform such as LinkedIn
2. OTT platforms such as Amazon Prime Video / Netfilix etc.
(You are free to think about the features in each machine. Think as many features as you can.
The more the better.)
Include as many steps as possible in your algorithm / flowchart. Use any construct that is
required. Rember you have to write the algorithm NOT THE PROGRAM. So forget about
coding construct and focus on different functions, their inputs and output.
Answer the following questions based on your understanding of the given flowchart:
Question 3:
The following quote is by Prof. G.H. Hardy, a British Mathematician when he visited Dr. S.
Ramanujan, the Indian Mathematician, when he was ill:
“I remember once going to see him when he was ill at Putney. I had ridden in taxi cab No.
1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was
not an unfavourable omen. "No," he replied, "it is a very interesting number; it is the smallest
number expressible as the sum of two cubes in two different ways."
And from then onwards 1729 is referred to as the Hardy–Ramanujan number.
The two different ways are: 1729 = 13 + 123 = 93 + 103
Write a C program to verify this claim. The program should take an integer ‘n’ and print all
integers less than or equal to n that can be expressed as the sum of two cubes in two different
ways. The program should also print the distinct positive integers a, b, c, and d such that a3 +
b3 = c3 + d3.
Further test whether the number 87539319 is also a dull number like it seems or does it also
follow the above rule?
--------------------------------------------End of Assignment----------------------------------------------