0% found this document useful (0 votes)
31 views8 pages

CSE 215L: Programming Language II Lab Faculty: Silvia Ahmed, Sec - 9, 10

This document outlines 9 tasks for a programming lab. Task 1 involves using a loop to take inputs, check if they are positive or negative, and count/sum each. Task 2 calculates tuition fees over 10 years using compound interest. Task 3 finds factors of a number. Task 4 is similar to Task 3. Tasks 5-6 involve pattern printing in Java. Task 7 prompts a user for a date and calculates the day of the next month. Task 8 follows instructions in a question. Task 9 is an extra challenge task to try optionally.

Uploaded by

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

CSE 215L: Programming Language II Lab Faculty: Silvia Ahmed, Sec - 9, 10

This document outlines 9 tasks for a programming lab. Task 1 involves using a loop to take inputs, check if they are positive or negative, and count/sum each. Task 2 calculates tuition fees over 10 years using compound interest. Task 3 finds factors of a number. Task 4 is similar to Task 3. Tasks 5-6 involve pattern printing in Java. Task 7 prompts a user for a date and calculates the day of the next month. Task 8 follows instructions in a question. Task 9 is an extra challenge task to try optionally.

Uploaded by

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

CSE 215L: Programming Language

II Lab
Faculty: Silvia Ahmed,
Sec – 9, 10
Lab 3 – Spring 2021
Task 01
• Use a loop to take inputs until user enters 0.
• Inside the loop statement, use if-else to check positive or
negative and declare two different variables to count them
respectively.
• Use one more variable to calculate the sum.
• After the loop, divide the sum by total number of inputs.
Task 02
• Here 10000 + 10000*1*(5/100) = 10500 and then again 10500
+ 10500 *1*(5/100) so use result to calculate the new tuition
fee for ten years.
• Then use the same formula in a loop that runs four times and
inside the loop each time you calculate the fee, add the fee to a
sum.
Task 03 and Task 04
• Use % operator to find factors and divide the number by
factors inside the loop.
• You can try them yourself.
Task 05 and Task 06
• See for java pattern printing.
• See this videos:
1. https://www.youtube.com/watch?v=LLDIiIyU1Pc&list=PLg
H5QX0i9K3oAZUB2QXR-dZac0c9HNyRa&index=49
2. https://www.youtube.com/watch?v=2Rquz1rstM4&list=PLg
H5QX0i9K3oAZUB2QXR-dZac0c9HNyRa&index=50
Task 07
• Prompt the user.
• Assigning the numbers to the weekdays is same as the task 03
of the lab manual 2.
• Add the number of days in the month (i.e. if user entered a
leap year, then you should add 29 for February) to the day.
• Then mod the sum by 7. and the result is the day of the first
day of the next month.
Task 08
• Follow the instructions in the question.
Task 09
• This is an extra task.
• If you feel interested you can try it yourself.

You might also like