Structured Programming Lab
CIS · Final · Spring 24
Section A&B · Batch Batch 19
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
LAB FINAL (SP)
Program: B.Sc. in CIS | Semester: Spring | Year: 2024 | Time: 60min | Marks: 40
Course Code: CIS 115L | Course Title: SP Lab | Section: A&B (Batch 19) | Date: 09-06-2024
1. Read an undetermined number of pairs values M and N (stop when any of these values is less or equal to zero). For each pair, print the sequence from the smallest to the biggest (including both) and the sum of consecutive integers between them (including both). 15
Input
The input file contains pairs of integer values M and N. The last line of the file contains a number zero or negative, or both.
Output
For each pair of numbers, print the sequence from the smallest to the biggest and the sum of these values, as shown below.
Input Sample | Output Sample
5 2 | 2 3 4 5 Sum=14
6 3 | 3 4 5 6 Sum=18
5 0 |
2. Write a program that will take 10 integer number as an input and display how many odd numbers and even numbers are exist. 10
Input: 12 3 45 23 20 7 18 53 76 29
Output:
Odd numbers = 6
Even numbers = 4
3. Mr. Roni is a student of Daffodil International University and his id number is 232-41-300. In Spring 2023 semester, he had enrolled 4 subjects such as SP, SP Lab, Algorithm and Statistics. He had received following points. Now write a code that will show his final SGPA. 15
Subject Name | Credit | GPA
SP | 3 | 4
SP Lab | 1 | 3.9
Algorithm | 4 | 3.7
Statistics | 3 | 4
Output: Mr. Roni Final SGPA is: 3.88