0% found this document useful (0 votes)
22 views6 pages

ICT Assignment 4

some assignment from fast nuces

Uploaded by

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

ICT Assignment 4

some assignment from fast nuces

Uploaded by

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

CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024

Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

CLO-03: Illustrate simple coding problems by representing an algorithm in the form of flowcharts
and solve them using C++ constructs.

Task # 1a:
a. Write a program to input any character and check whether it is alphabet, digit or special
character.
b. Determine the shipping cost based on weight and delivery speed:

Weight <= 5kg: $5 standard, $10 express.


Weight > 5kg and <= 20kg: $10 standard, $20 express.
Weight > 20kg: $20 standard, $40 express.
If weight > 50kg, express delivery is not available.

c. Write a program that takes three integers as input and evaluates them based on the following
rules:

If all three numbers are even, calculate their product.


If all three numbers are odd, calculate their sum.
If two numbers are even and one is odd, calculate the difference between the sum of the
even numbers and the odd number.
If two numbers are odd and one is even, calculate the quotient of the even number divided by
the sum of the odd numbers (rounded to two decimal places).
If any of the numbers are negative, print "Invalid Input".

Task 1a
a.

Outputs:

Page 1 of 6
CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024
Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

b.

Page 2 of 6
CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024
Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

Outputs:

Page 3 of 6
CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024
Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

Task #1b:
a. Determine the value in total after each of the following loops is executed:

Note: you can use dev C++ to verify your answers.

Task # 2:
a. Construct flowchart and write C++ code for following program:

i. Ask user to enter 10 even numbers. Keep on asking numbers until 10 even numbers are entered.
ii. Find the sum of all even numbers entered by the user.

Example:
User input: 10 -10 2 -2 4 -4 6 -6 20 18
Positive sum = 38

b. Drive the user crazy by insisting they re-enter a particular input no matter what, they enter. Be
creative...

Task # 3:
Ask user to enter the length and width of 5 rectangle boxes to calculate their respective areas. Ensure
that both dimensions are positive; otherwise, an error message will be displayed, prompting you to re-
enter the dimensions until all 5 boxes' dimensions are provided.

Task # 4:

Page 4 of 6
CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024
Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

Write a C++ program, that check the number entered by the user is prime number or not. Implement
this task using for loop.

Task # 5:
Write a program to print out the binary equivalent of a positive integer value entered. Implement this
task using for loop.

[Reverse binary string is accepted as output. For example, the binary of 4561 is 1000111010001 but if
the user outputs it in reverse, i.e., 1000101110001, it is accepted. Just mention that LSB is the left
most bit]

Task # 6:
Dry run the following code for following values and mention the output.
1. price=1000
2. price=-10

Task # 7:
Answer the following for the given flowchart below.

User enters a = 5 and r = 2.


Fill in the table at each iteration/value of i. (First row has been
completed for you)

Value of i Value of a Value of r Output on


window
0 10 2 10

Page 5 of 6
CS-1009 Applications of ICT (EE) / SEC A, B, C / Fall’24 / Assignment -04 / CLO-03 15/10/2024
Marks: 100
Name: _Mohammad Ali____________________________________________ Roll No:
i246002________________ Section: _A_______

Instructions:
1. Submit the assignment in SOFTCOPY on GCR before the deadline. Implement the code on DevC++.
Submit code and screenshot both.
2. Name the submission document as: CS1009 Fall 24 Assignment 4 CLO3 Roll No (e.g. 23i-0456)
3. Do fill in your name, roll number, and section above.
4. Plagiarism will be penalized severely.
5. Not following the instructions can lead to submission rejection or marks deduction.
6. Submission deadline 26 Nov 2024.
7. Late assignments won’t be accepted.

Page 6 of 6

You might also like