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
Karo-lina-s [1.5K]
3 years ago
14

Python pseudocode: Can anyone please help me please? I’m so desperate for the answer.

Computers and Technology
1 answer:
Katena32 [7]3 years ago
8 0

Answer:

You need “input(prompt)” and “sum(iterable)”

Explanation:

import numpy

class Students:

   def __init__(self, students_size, marks_size):

       self.students_size = students_size

       self.marks_size = marks_size

   def input_name(self):

       return input("Name of the student:")

   def input_marks(self):

       for __ in range(self.marks_size):

           yield int(input("Mark:"))

   def input_students_data(self):

       for __ in range(self.students_size):

           name = self.input_name()

           yield name, list(self.input_marks())

if __name__ == "__main__":

   students = Students(students_size=3, marks_size=5)

   name = numpy.empty([students.students_size], dtype="<U100")  

   # more space might be needed for long names      

   marks = numpy.empty([students.students_size, students.marks_size])

   for i, (student_name, student_marks) in enumerate(                        

           students.input_students_data()):

       name[i] = student_name

       marks[i] = student_marks

       total = sum(student_marks)

       print("total: {:g}, average: {:g}".format(total, float(total)/students.marks_size))

You might be interested in
Is a book considered technology?
kumpel [21]
Yes, "technology" doesn't have to be all about computers or cell phones.. Technology is anything that is a new advance in knowledge and books were once a great advance in that field.
7 0
3 years ago
Read 2 more answers
Create a derived class called Car that inherits from Vehicle. The constructor should call the base class constructor, with 4 for
Vitek1552 [10]

Answer:

Hi there Foodalexandre! The question is good to revise knowledge on the concepts of classes and inheritance. Please find the answer with explanation below.

Explanation:

We can use a number of different object-oriented programming languages to implement this solution in, such as Java, C++, Ruby, etc. I have chosen to use Python as the language to implement because of the ease with which it can be used. First, I have defined the Vehicle class based on the description from the question, where the constructor (the __init__ method) initializes the door count and the engine sound, and the original Move() method belonging to the Vehicle class is defined. Then I define the Car class which inherits from the Vehicle class making it inherit the Vehicle properties, and initialize the Car class to have door count of 4 and engine sound as 'rrrrrr'. Defining the Move() method again in the Car class overrides the one in the Vehicle class, and the RoadTrip() method is added to return the string as requested in the question.  

class Vehicle(object):  

 def __init__(self, door_count, engine_sound):    

   door_count: door_count      

   engine_sound: engine_sound    

 def Move() :

   return ‘rrrrrr’  

class Car(Vehicle):  

 def __init__(self, door_count, engine_sound):    

   super().__init__(4, ‘rrrrrr’)  

 def Move():    

   return ‘vrumm’    

 def RoadTrip() :    

   return “Not a care in the world”

3 0
3 years ago
Why a management-focused program provides a more appropriate learning path for you than a program based heavily on technical con
AlekseyPX
The program makes more money
3 0
3 years ago
Draw a flowchart that solve the problem of calculating the average of 5 numbers.
KatRina [158]

Answer:

Draw a flowchart that solve the problem of calculating the Area of circle

Pie x r x2

Explanation:

3 0
2 years ago
What are career values
NikAS [45]

Answer:hdhfnrjrjkejd

Explanation:

4 0
2 years ago
Other questions:
  • What term is used to describe a function that uses an algorithm to convert an input of letters and numbers into an encrypted out
    9·1 answer
  • True or False: You cannot change the default margin size for Word documents.  
    6·1 answer
  • which virtue you need to secure information by limiting computer access to authorized personnel only?
    10·1 answer
  • Which of the following works on the pay-per-click (PPC) and cost-per-click (CPC) concept? ~ Plato
    9·1 answer
  • A palindrome is a string that reads the same both forward and backward. For example, the string madam is a palindrome. Write a p
    13·1 answer
  • Where do i put the lines?
    11·1 answer
  • What can hack or code can I use to get a shadow or frost dragon in adopt me
    6·2 answers
  • Compare gigabytes GB, kilobytes and terabytes.​
    11·1 answer
  • How does social network use message to entertain?
    14·1 answer
  • What is the complete path and filename of the file where ports and their associated protocols are defined
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!