answersLogoWhite

0

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

11y ago

What else can I help you with?

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 the average masters GPA of students in your program?

The average GPA of students in our program is 3.5.


What is the average cumulative GPA of students in the program?

The average cumulative GPA of students in the program is 3.5.


What is the average graduate GPA of students in the program?

The average graduate GPA of students in the program is 3.5.


What is the average age of doctoral students in your program?

The average age of doctoral students in our program is approximately 30 years old.


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.


What is the average graduate school GPA of students admitted to this program?

The average graduate school GPA of admitted students in this program is 3.5.


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


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

Here’s a simple Java program that prompts the user for the number of students and then collects marks for five subjects to print a marksheet: import java.util.Scanner; public class MarksSheet { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the number of students: "); int numStudents = scanner.nextInt(); for (int i = 1; i <= numStudents; i++) { System.out.println("Entering marks for Student " + i); int[] marks = new int[5]; for (int j = 0; j < 5; j++) { System.out.print("Enter marks for Subject " + (j + 1) + ": "); marks[j] = scanner.nextInt(); } System.out.println("Marks for Student " + i + ": " + java.util.Arrays.toString(marks)); } scanner.close(); } } This program uses a loop to gather and display marks for each student across five subjects.


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.


What are the average PhD fees in the USA for international students?

The average PhD fees for international students in the USA range from 20,000 to 40,000 per year, depending on the university and program.