answersLogoWhite

0


Best Answer

DIM grade(6), lowGrade(5), testName$(6), seq$(6)

seq$(1) = "first "

seq$(2) = "second"

seq$(3) = "third "

seq$(4) = "fourth"

seq$(5) = "fifth "

grLetter$ = "ABCD"

begin:

COLOR 7, 0

CLS

PRINT "Test averaging program"

PRINT "======================"

PRINT

PRINT "Lets enter some basic info before we get started .."

PRINT

FOR ix% = 1 TO 4

PRINT "enter a number (1-100) that you consider to be the lowest "; MID$(grLetter$, ix%, 1);

INPUT lowGrade(ix%)

PRINT STRING$(78, "-")

NEXT ix%

enterTests:

COLOR 7, 0

CLS

LINE INPUT "Enter student name or / to end program: "; name$

IF name$ = "/" THEN

CLS

END

END IF

LINE INPUT "Enter student age : "; age$

age% = VAL(age$)

PRINT STRING$(78, "=")

FOR ix% = 1 TO 5

PRINT "Enter the subject name for the "; seq$(ix%); " test: ";

LINE INPUT testName$(ix%)

LINE INPUT "Enter the grade for this test (1-100): "; grade$

grade(ix%) = VAL(grade$)

PRINT STRING$(78, "-")

NEXT ix%

CLS

displayReport:

COLOR 7, 0

CLS

GOSUB computeAverage

PRINT "Test Average Report for "; name$

PRINT

PRINT "Age is "; age$

IF (age% >= 25) = 0 THEN

COLOR 6, 0

PRINT " ** Student is underage **"

END IF

COLOR 7, 0

stuGrade = average

GOSUB determineAthruF

PRINT "Test average is";

PRINT USING "###.##"; average

PRINT "This is a grade of "; grade$

IF grade$ = "F" THEN

COLOR 4, 0

PRINT "** Student did not pass **"

END IF

COLOR 7, 0

PRINT

PRINT "Test Summary (those in ";

COLOR 4, 0

PRINT "red";

COLOR 7, 0

PRINT " are failing)"

PRINT

FOR ix% = 1 TO 5

COLOR 7, 0

stuGrade = grade(ix%)

GOSUB determineAthruF

rptName$ = SPACE$(25)

MID$(rptName$, 1) = testName$(ix%)

IF grade$ = "F" THEN

COLOR 4, 0

END IF

PRINT rptName$, grade$,

PRINT USING "###.##"; stuGrade

NEXT ix%

COLOR 7, 0

PRINT

LINE INPUT "Do you wish to average another student (Y/N) "; yn$

yn$ = UCASE$(yn$)

IF yn$ = "Y" THEN

GOTO enterTests

END IF

END

computeAverage:

total = 0

FOR ix% = 1 TO 5

total = total + grade(ix%)

NEXT ix%

average = total / 5

RETURN

determineAthruF:

IF stuGrade >= lowGrade(4) THEN

grade$ = "D"

IF stuGrade >= lowGrade(3) THEN

grade$ = "C"

IF stuGrade >= lowGrade(2) THEN

grade$ = "B"

IF stuGrade >= lowGrade(1) THEN

grade$ = "A"

END IF

END IF

END IF

ELSE

grade$ = "F"

END IF

RETURN

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program in qbasic to input marks of 10 students in 5 subjects and display the average of each students?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write a c program that computes results of 10 students for any given 4 subjects grading their results from a A to U?

ghfj


Write a c program to generate student mark details using union and find total and average and grade?

write a c program to display marks,total,average,grade using union


How do you write a program in C that will captures details The details to be captured are student name mark and age The program should calculate and display the average marks for all the students?

Create a data structure to store the details for each student: typedef struct student_t { char name[30]; unsigned age; unsigned mark; } student; Establish an array to store the student data: size_t max = 100; // replace 100 with the actual number of students student students[max]; Use a loop to enter the data: for (size_t i=0; i<max; ++i) { printf ("Student name: "); scanf ("%s", students[i].name); printf ("Student age: "); scanf ("%u", students[i].age); printf ("Student mark: "); scanf ("%u", students[i].mark); } Calculate and display the average mark: unsigned sum = 0; for (size_t i=0; i<max; ++i) sum += student[i].mark; printf ("Average mark: %d\n", sum / max_students);


How do you start the display program in Linux from the command line?

the command "display" brings up the ImageMagick program.


How do you get a Java program to display a backslash in output without it interpreting it as a program command?

Follow the backslash with another backslash: System.out.println("\\ " \"); will display \ " \ on the screen.

Related questions

What is Moshal Scholarship Program?

Moshal Scholarship Program provides scholarships to disadvantaged students in Israel and South Africa. The program offers full scholarships to students in a select range of subjects.


C program to print mark sheet of 5 subjects and the number of students is user input?

hhh


How do you write a c program that computes results of 10 students for any given 4 subjects grading their results from a A to U?

ghfj


Which group of people is the TAMS educational program aimed at?

The TAMS or Texas Academy of Mathematics and Science educational program is aimed at high school aged Texas students with good achievements. Those students should be interested in subjects of mathematics and science.


What scholarship programs are available to B students in Florida?

Florida Students Carrying a B Average Grade Can Apply to the Bright Futures Scholarship Program, the Florida Student Assistance Grant Program, and the Mckay Scholarship Program.


Write a c program to generate student mark details using union and find total and average and grade?

write a c program to display marks,total,average,grade using union


How do you write a program in C that will captures details The details to be captured are student name mark and age The program should calculate and display the average marks for all the students?

Create a data structure to store the details for each student: typedef struct student_t { char name[30]; unsigned age; unsigned mark; } student; Establish an array to store the student data: size_t max = 100; // replace 100 with the actual number of students student students[max]; Use a loop to enter the data: for (size_t i=0; i<max; ++i) { printf ("Student name: "); scanf ("%s", students[i].name); printf ("Student age: "); scanf ("%u", students[i].age); printf ("Student mark: "); scanf ("%u", students[i].mark); } Calculate and display the average mark: unsigned sum = 0; for (size_t i=0; i<max; ++i) sum += student[i].mark; printf ("Average mark: %d\n", sum / max_students);


What is the answers to stars suite?

Stars suite is an online program for US students their curriculum includes most subjects including Language arts, mathematics, science, social sciences, world languages and further elective subjects. You cannot gain the answers to the questions in advance and have to work through the program online.


How do you start the display program in Linux from the command line?

the command "display" brings up the ImageMagick program.


Defination of Bachelor of Commerce {BCom}?

B.Com, or Bachelor of Commerce, is a three-year undergraduate degree program in commerce and related subjects. It is designed to provide students with knowledge and skills in the areas of business, finance, accounting, economics, and management. The program is designed to help students develop the necessary skills for a successful career in the business world.


Defination of Bachelor of Commerce {Bcom}?

BCom, or Bachelor of Commerce, is a three-year undergraduate degree program in commerce and related subjects. It is designed to provide students with knowledge and skills in the areas of business, finance, accounting, economics, and management. The program is designed to help students develop the necessary skills for a successful career in the business world.


When was Victorian Students' Aid Program created?

Victorian Students' Aid Program was created in 2005.