0% found this document useful (0 votes)
2 views

Programming roadmap 2

The document outlines a series of programming tasks involving one-dimensional and two-dimensional arrays, specifically focusing on student names and their corresponding marks. It requires the use of FOR loops to print names and marks, as well as to calculate and display statistics such as highest marks, distinctions, and grades. The tasks emphasize accessing array elements individually rather than using built-in print functions for arrays.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Programming roadmap 2

The document outlines a series of programming tasks involving one-dimensional and two-dimensional arrays, specifically focusing on student names and their corresponding marks. It requires the use of FOR loops to print names and marks, as well as to calculate and display statistics such as highest marks, distinctions, and grades. The tasks emphasize accessing array elements individually rather than using built-in print functions for arrays.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Concepts Covered: Input, Output, Counter, Total, Average, Percentage,Highest, Lowest

Note: (This series of questions involves use of Arrays)

Important: This set of questions is based on the following one dimensional and two dimensional
arrays

NAMES:

Ali

Ahmed

Asad

Omar

Fahad

MARKS:

55 65 70 90

88 77 66 44

90 91 77 38

87 100 75 91

64 84 93 70

1- Write code that outputs all the names in the Names array. You must use a FOR loop to print
the values inside the array by accessing one element at a time and outputting the value as
shown below
e.g. print(Names[0]) <- This statement outputs the name of the student stored in
element 0 of the Names array

print(Names) works in python but it is not an acceptable solution for this question

2- Write code that prints all the values stored in the two dimensional Marks array by using a
FOR loop. The values must be printed in order of rows i.e. row wise processing.
Your code must access the values inside the array one element at a time and print them.

print(Marks) works in python but I won’t accept this solution…


3- Write code that prints all the values stored in the two dimensional Marks array by using a
FOR loop. The values must be printed in order of columns i.e. column wise processing.
Your code must access the values inside the array one element at a time and print them.

print(Marks) works in python but I won’t accept this solution…

4- Write code that prints the name of each student and outputs his marks in the same row.
Every students name and marks should be printed in a separate row

5- The marks stored in each column are for different subjects. Col1 is Physics, Col2 is Maths,
Col3 is Computer Science and Col4 is Chemistry. You are required to output the name of each
subject and the marks scored in that subject

6- Write code that outputs the highest marks stored in the class in any subject and output the
name of the student who scored the highest marks as well as the subject in which these marks
were scored

7- A score of 100 marks in the exam means a student scored distinction. Write code to check if
any of the students scored a distinction. Output the name of the student and the subject in
which he scored distinction

8- Write code to output the result of each student in terms of Grades


Grade A: 81-100
Grade B: 71-80
Grade C: 61-70
Grade D: 51-60
Grade E: 50 and below

Since Ali scored 55 60 70 90 his grades were D D C A

You are required to do the output as follows


Ali D D C A
Incomplete I’ll be adding more questions soon

You might also like