0% found this document useful (0 votes)
6 views7 pages

SPI Tutorial Week 5 Submission Guide

This document provides information and instructions for submitting assignments for SPI SEPT 2020 Tutorial Week 5 on 15th October 2020. It lists the activities and exercises due for Units 5 and 6, and provides the link for online submission. It also includes sample C code for a switch statement and instructions for Exercises 6.2 and 6.3, which involve getting user input to calculate values that meet certain criteria.

Uploaded by

Muhd Arif
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)
6 views7 pages

SPI Tutorial Week 5 Submission Guide

This document provides information and instructions for submitting assignments for SPI SEPT 2020 Tutorial Week 5 on 15th October 2020. It lists the activities and exercises due for Units 5 and 6, and provides the link for online submission. It also includes sample C code for a switch statement and instructions for Exercises 6.2 and 6.3, which involve getting user input to calculate values that meet certain criteria.

Uploaded by

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

SPI SEPT 2020

TUTORIAL
WEEK 5
15TH OCT 2020
Things to submit:
UNIT 5: UNIT 6:
1. Activity 5.1 1. Activity 6.3
2. Activity 5.2 2. Exercise 6.2
3. Activity 5.4 3. Exercise 6.3
4. Activity 5.7
5. Exercise 5A
Link Submission:

[Link]
nWBFUBCpDgJL47RN5-
_9vWCSFIVQf5QIwuQie4WW6YZZ2l1wy5-
qMnzzAITABb5TwnhXtMbbA/pubhtml?
gid=1034784007&single=true
QUESTION & ANSWER
Extra info:
#include<stdio.h>
int main(void)
{
char entry;
printf(“\nPlease enter a letter ”);
scanf(“%c”,&entry);
switch(entry){
case ‘a’…’z’:
case ‘A’…’Z’:
printf(“This is a letter %c \n”, entry);
break;
default:
printf(“%c is not a letter \n”, entry);
break;
}
return 0;
}
Exercise 6.2:
Get min
1. Ask user input for min, max, and div do
2. min < div < max
Get max
3. 1 < div < 11
max <= min while
max
do

1. div <= min Get div


2. div >= max
while
3. div <=1 or div >=11 div

Remainder operator: List number between min and


% max that can be divided by div
Exercise 6.3:
1. Keep asking for user input n until user do
entered n < 1 or n > 100
Get n
2. Calculate total of all valid numbers n>0
3. Calculate average n < 101 while
n
n < 1 , n > 100
Print
1. total for all valid numbers
2. Average = sum/count

You might also like