The purpose of this assignment is to provide you with experience in coding programs that make use of parallel lists. This program maintains 2 parallel lists. The first list maintains names of students and the second list maintains their grades. These 2 parallel lists are shown below:

Elements in parallel lists are processed as a pair. For example, the student whose name is maintained in the 1st element in the lst_stu_names list has a grade that is the first element in the lst_stu_grades list. The subscripts used to access the elements in the list are also shown in the graphic.

The program prints out the contents of the 2 parallel lists and performs computations. A "*" is printed across students who have an "A" in the class.

After the list has been processed, it prints out the total number of students in class (which is the same as the length of each list), the number of "A" and "F" students. Also printed are the number of "A" and "F" students as a percentage of the entire class.

def main():
    # Setup variables. DO NOT changes lines 3-9
    lst_stu_names = ["Barba", "Lenard", "Ashley", "Marylynn",
                     "Mozella", "Laveta", "Ardis", "Vinnie",
                     "Kathie"]
    lst_stu_grades = ["A", "C", "B", "B",
                     "D", "A", "F", "A", "C"]
    print("# Student\tGrade\n--------------------------")

    num_A_stu = 0
    num_F_stu = 0

    for i in range(len(lst_stu_names)):
        if lst_stu_grades[i]:
            print(lst_stu_names[i],lst_stu_grades[i])
        else:
            print(lst_stu_names[i],lst_stu_grades[i])

    num_A_stu = 0
    num_F_stu = 0
 main()

I only have the graph How do i write to get the number of students, number of A students, and Number of F students calculated! It's due tomorrow!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.