Write a program to analyze the test scores

Assignment Help Python Programming
Reference no: EM132356509

Question

An instructor teaches two classes this semester. Recently he gave the same test to both classes. Write a program to analyze the test scores.

(a) Enter the scores of students in class 1. Every time after a score is entered, ask whether the user wants to enter another score. Store the scores in a list.

(b) Enter the scores of students in class 2. Every time after a score is entered, ask whether the user wants to enter another score. Store the scores in a list.

(c) Display the number of scores in class 1 and all the scores in class 1.

(d) Display the number of scores in class 2 and all the scores in class 2.

(e) Combine the two score lists. Display the combined list.

(f) Display the highest score in the combined list.

(g) Display the lowest score in the combined list.

(h) Sort the scores in the combined list in ascending order (i.e. from smallest to largest). Display the sorted list.

(i) Sort the scores in the combined list in descending order (i.e. from largest to smallest). Display the sorted list.

The following is an example.

Enter test scores of class 1.

Enter a score: 56

Add another score? [y/n] y

Enter a score: 78

Add another score? [y/n] y

Enter a score: 89

Add another score? [y/n] n

Enter test scores of class 2.

Enter a score: 99

Add another score? [y/n] y

Enter a score: 78

Add another score? [y/n] n

There are 3 students in class 1.

Scores in class 0001:

[56.0, 78.0, 89.0]

There are 2 students in class 2.

Scores in class 0002:

[99.0, 78.0]

There are 5 students in class 1 and class 2 combined.

Scores in combined list:

[56.0, 78.0, 89.0, 99.0, 78.0]

The highest score in the combined list is 99.0

The lowest score in the combined list is 56.0

Scores in the combined list sorted in ascending order:

[56.0, 78.0, 78.0, 89.0, 99.0]

Scores in the combined list sorted in descending order:

[99.0, 89.0, 78.0, 78.0, 56.0]

Save your Python program in a file named Lab11P1.py. Submit the file to Blackboard for credit.

Problem 2

Write a program to do the following:

(a) Generate 10 random integers in the range of 1 through 4. Store them in a list named list1. Display list1.

(b) Create a new list named list2. Copy the last 5 elements of list1 there. Display list2.

(c) Remove all occurrences of 2 from list2. Display the list. There should be no 2s in there anymore.

The following is an example.

List 1:

[4, 1, 1, 3, 3, 3, 2, 4, 2, 4]

List 2:

[3, 2, 4, 2, 4]

List 2 with all 2s removed:

[3, 4, 4]

Reference no: EM132356509

Questions Cloud

Read a four digit decimal integer from the keyboard : Subject Use Python IDLE, select file menu then new file command to edit and debug your program. Write a complete Python program.
How many times each letter of the alphabet was used : Allow the user to type in a sentence to allow the program to perform analytics. Find out how many times each letter of the alphabet was used in useras sentence.
Analyze a comma-separated values file of real estate data : Write a menu driven console program that loads, parses and analyzes a comma-separated values file of real estate data.
Display the stripped phone number : Ask the user to enter the 4-digit code of an orange. Strip all the leading and trailing whitespace characters from the code. Display the stripped phone number.
Write a program to analyze the test scores : An instructor teaches two classes this semester. Recently he gave the same test to both classes. Write a program to analyze the test scores.
Display the array of names and the array of votes to provide : Write a function that accepts the name of an output file and displays the array of names and the array of votes to the provided output file.
Identify and describe one federal public health law : Key Participants in Decision Making - Identify and describe one federal public health law and the key decision makers in getting the law passed
Write a python program to list the data types used in this : Write a Python program to load the exact data into a data frame df2016. Write a Python program to list the data types used in this data frame.
Describe the events that led us into war : Describe the events that led us into war despite the isolationist views. What lessons can be drawn from this experience for our modern day con cerns about war.

Reviews

Write a Review

Python Programming Questions & Answers

  Prepare a complete flow chart for the project

Implementing the design using principles of correct syntax, layout, and program structure - Prepare a Complete Flow Chart for the Project - Write the code

  Read and analyse the ice cream weekly sales data

ICT702 - Data Wrangling - university of sunshine coast - Below Zero - ice cream store - read and analyse the ice cream weekly sales data and generate various

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Give examples that show different features of string slices

Give at least three examples that show different features of string slices. Describe the feature illustrated by each example. Invent your own examples.

  The command line argument implement in python

The StackMachine class should have eight member functions: push, pop, add, sub, mul, div, mod and the constructor.

  Calculate how many years it will take to double investment

Execute a quick calculator that prompts for the rate of return on an investment and calculates how many years it will take to double your investment.

  Input a temperature as a floating point

Your program should input a temperature as a floating point number with an appended unit letter. It should then print the temperature in all four of the units above

  Write a function long strings that has one argument

Write a function long strings that has one argument- file name that is a string that is the name of a text file.The file will consist of a number of lines.

  Create a Python program to implement Stack ADT

Create a Python program to implement Stack ADT using both Lists and Linked Lists that includes the following operations: To add a data element in the stack.

  Write a python code to guess the number for given problem

They have only 5 times to enter the right value. After five time, if they still haven't guessed the number, show them the right number.

  Design part of the code for the haunted house game

Create a cheat commands in the game so player can teleport to any location in the map - You are tasked with improving and designing part of the code for the Haunted House game.

  Ask the user for a length and a width of a rectangle

Asks the user for a length and a width of a rectangle. Each or all input will happen in a function and will then be returned from a function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd