1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
velikii [3]
3 years ago
13

Create a funtion makeStudent(studentlist) where studentlist is your list of Student namedtuples The function should do the follo

wing: Take user input for each of the fields of the namedtuple Create a Student namedtuple using the input Add the Student to studentlist
Computers and Technology
1 answer:
seropon [69]3 years ago
4 0

Answer:

def makeStudent(student_list):

   name = input()

   major = input()

   year = int(input())

   hhh = int(input())

   gpa = float(input())

   newstu = Student(name,major,year,hhh,gpa)

   student_list.append(newstu)

def setGPA(student,val):

   student = student._replace(gpa= val)

   return student

def setMajor(student,val):

   student = student._replace(major = val)

   return student

def setYear(student,val):

   student = student._replace(year = val)

   return student

def averageGPA(student_list):

   sum = 0

   for i in range(len(student_list)):

       sum = sum + student_list[i].gpa

   avg = sum/len(student_list)

   return avg

def getTopStudentGPA(student_list):

   max = -1000

   for i in range(len(student_list)):

       if student_list[i].gpa > max:

           max = student_list[i].gpa

   return max

Student = namedtuple('Student', ['name', 'major', 'year', 'id', 'gpa'])

stu1 = Student('Kenneth', 'Computer Science', 6, 987654321, 3.8)

stu2 = Student('Maegan', 'Neuroscience', 4, 123456789, 3.4)

namedlist = []

print (namedlist)

namedlist.append(stu1)

namedlist.append(stu2)

print(namedlist)

makeStudent(namedlist)

makeStudent(namedlist)

makeStudent(namedlist)

print(namedlist)

print(namedlist[1])

print(namedlist[3])

Explanation:

  • Create a function to take in in the information of a new student.
  • Create functions for setting GPA, a major subject and year.
  • Calculate average GPA by dividing the total GPA of student with the length of student list.
  • Get top student by checking the student having a maximum GPA .
You might be interested in
Write a program that takes as input a number of kilometers and prints the corresponding number of nautical miles. Use the follow
Dmitrij [34]
<h2>Answer:</h2>

import java.util.Scanner;

public class NauticalMiles{

   public static void main (String [ ] args){

      Scanner input = new Scanner(System.in);

      System.out.println("Please enter the number of kilometers");

      double km = input.nextDouble();

      double nm = 0.54 * km;

      System.out.println("The corresponding number of nautical miles is "  + nm);

    }

}

<h2>Explanation:</h2><h2></h2>

<em>1 => Pre-code analysis</em>

According to the question,

(a) <em>A nautical mile (nm) is 1 minute of an arc.</em>

=> 1 nm = 1 minute of an arc

(b)<em>There are 90 degrees, each containing 60 minutes of arc, between the North pole and the equator.</em>

=> Each of the degrees in 90 degrees has 60 minutes of arc

=> 1^{0} = 60 minutes of arc

=> 90^{0} = 90 x 60 minutes of arc

=> 90^{0} = 5400 minutes of arc

(c) <em>A kilometer (km) represents 1/10,000 of the distance between the North pole and the equator. </em>

=> A kilometer = (1 / 10000) x distance between the North pole and equator.

Remember that the distance between the North pole and the equator as shown in (b) above is 90 degrees which is equal to 5400 minutes of arc.

=> 1 km = (1 / 10000) x 5400 minutes of arc

=> 1 km = (1 / 10000) x 5400 x 1 minute of arc

As shown in (a) above, 1 minute of arc is 1 nautical mile(nm).

=> 1 km = (1 / 10000) x 5400 x 1 nm

<em>=> 1 km = 0.54 nm.</em>

=========================================================

<em>2 => The code analysis</em>

The code has been written in Java.

The following is the line-by-line explanation of the code written as comments.

// Import the scanner class to allow for user's inputs

import java.util.Scanner;

// Declare the main class to hold and run the application

public class NauticalMiles {

   // Write the main method where execution will begin

   public static void main (String [ ] args) {

      // Create an object <em>input </em>of the Scanner class  

      Scanner input = new Scanner(System.in);

     

      // Prompt the user to enter the number of kilometers

      System.out.println("Please enter the number of kilometers");

      // Store the user's input in a double variable called <em>km</em>

      double km = input.nextDouble();

      // Convert the input to nautical miles using the formula from the

      // pre-code analysis above. i.e 1km = 0.54nm.

      // Store the result in a double variable called <em>nm</em>

      double nm = 0.54 * km;

      // Print out the result (the nautical mile)

      System.out.println("The corresponding number of nautical miles is "  + nm);

    }       // End of main method

}            // End of class declaration

=========================================================

<em>3 => Sample output</em>

<em></em>

> Please enter the number of kilometers

>> <em>45</em>

> The corresponding number of nautical miles is 24.3

8 0
4 years ago
Terry is having a problem with his computer screen. He said the screen looks distorted. When you go to check his monitor, you no
andreyandreev [35.5K]

Answer:

B. Computer's resolution has been set too low

Explanation:

A. Font size has been set too high.

B. Computer’s resolution has been set too low.

C. Refresh rate of the video card is out of sync with the monitor’s refresh rate.

D. ClearType setting is enabled.

From the given options; if the font size has been set too high, the effect is on the texts and not icons. If the video card is out of sync there will be little or no display at all.

So, the correct option is Computer's resolution has been set too low.

3 0
3 years ago
write a Program which displays at least 5 different sentences that explain how technology has been used to win souls to Christ.
creativ13 [48]

Answer:

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>cout<<"Technology Has been Used to Win Souls to Christ through Some of these means"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>cout<<"1.\t Through Ministry and Church Websites"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>cout<<"2.\t Through Internet Media on the Web (Podcasts, simulcasts etc) for gospel streaming"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>cout<<"3.\t Keeping in touch or follow-up of new converts through social media platforms"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>cout<<"4.\t Receiving Monetary seed donations online from members accross the world (Paypal, Western Union etc)"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>cout<<"5.\t Through keeping up to date Membership records and church attendance data Analysis"<<endl;</em>

<em>cout<<" "<<endl;</em>

<em>    return 0;</em>

<em>}</em>

Explanation:

The following program in C++ prints out five sentences using multiple cout statements outlining how technology has been used to win souls to Christ Jesus

5 0
3 years ago
A student builds a model of her bedroom. The scale is 1:25. In the scale model, the students bed is 3 inches long. How long is t
Fittoniya [83]

Answer:

The student’s actual bed is 75 inches long

Explanation:

Here in this question, we want to find out the length of the student’s actual bed.

The ratio of the model to the real is 1:25

Let the actual length of the bed be x inches

Thus;

1/25 = 3/x

By cross multiplying

1 * x = 3 * 25

x = 75 inches

5 0
3 years ago
Martin is responsible for translating the script into a visual form by creating a storyboard. Which role is he playing?
iren2701 [21]

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The question is about to  identify the role of Martin, who converts script into visual form by creating a storyboard.

The correct answer to this question is:

Martin is playing the role of <u>Production Design</u> and he is working at the position of the <u>production designer</u>.

Before shooting a film, the production designer is the first artist who converts script into a visual form such as creating storyboards. And, that storyboard serves as the first film draft.

A storyboard is a series of sketches, paintings, etc arranged on a panel to show the visual progress of the story from one scene to the next.   These storyboards are used from start to finish of the film. Because these storyboards or sketches serve as the visual guide for the director of the film throughout the production.  

8 0
3 years ago
Other questions:
  • To track conversions in an app, you can add the firebase sdk to your app. sdk stands for:
    5·1 answer
  • What is one way to measure technological progress?
    5·1 answer
  • Unless you explicitly initialize global variables, they are automatically initialized to
    5·1 answer
  • What file extension is used to name a compressed folder
    10·1 answer
  • Which term describes the second core IPSec security protocol; it can perform authentication to provide integrity protection, alt
    13·1 answer
  • Grading on the curve is a method of grading that is based on the belief that letter grades for any given class should be distrib
    8·1 answer
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • 9.6 Code Practice<br> Instructions<br> 1<br> Declare a 4x 5 array called N<br><br> Please helppp
    9·1 answer
  • Uh i g08ujunuyv kjmn
    11·2 answers
  • Write an if-else statement that assigns 0 to the variable b if the variable a is less than 10. Otherwise, it should assign 99 to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!