0% found this document useful (0 votes)
26 views2 pages

Class Assignment (Section D) - CS-104

Uploaded by

hheggwhhwwj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Class Assignment (Section D) - CS-104

Uploaded by

hheggwhhwwj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

July-December 2024-25

Course Name & Code: Computer Programming (CSE104)


Program & Sem: B.Tech 1st year 1st Sem
Section: D

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.

Question 2: A Cultural Night is being organized by an organization. The organization is using


a software for calculating how much a group of people should pay for entry. The flowchart of
the software being used is given below.

Answer the following questions based on your understanding of the given flowchart:

i. What are variables that are being used by the software?


ii. Redraw the flowchart on your answer sheets and label where each of the three
constructs (sequence, selection and iteration) are used.
iii. Write the algorithm for calculating the total amount to be paid as per the information
provided in the flowchart.
iv. The family of Mr. X has arrived at the event venue. The family consists of three children
(one aged 8, one aged 10, and one aged 14), their two parents and their grandfather,
who is aged 70. Use your algorithm to calculate the total amount that the family needs
to pay.

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----------------------------------------------

You might also like