3.2 Task Two: Movie Statistics (30 marks) Write a object-oriented program that can be used to gather statistical data about the number of movies college students see in a month. The program should survey students in a class stored in an array. (1)A student should has the properties such as : int age, int movies, char gender. Value for a gender variable could be 'F' or 'M'. (2)The program should define a function (or member function) allow the user to enter the number of movies each student has seen. (3)The program should then define Four (member) functions to calculate the average, largest , smallest number of movies by the students. And, compare the total movie number between the male and female students. (4)Run the program and capture screenshots of output

Answers

Answer 1

Here's an object-oriented Python program that gathers statistical data about the number of movies college students see in a month:

class Student:

   def __init__(self, age, movies, gender):

       self.age = age

       self.movies = movies

       self.gender = gender

class MovieStatistics:

   def __init__(self):

       self.students = []

   def add_student(self, student):

       self.students.append(student)

   def enter_movies(self):

       for student in self.students:

           movies = int(input(f"Enter the number of movies seen by student (Age: {student.age}, Gender: {student.gender}): "))

           student.movies = movies

   def calculate_average(self):

       total_movies = sum(student.movies for student in self.students)

       average = total_movies / len(self.students)

       return average

   def find_largest(self):

       largest = max(student.movies for student in self.students)

       return largest

   def find_smallest(self):

       smallest = min(student.movies for student in self.students)

       return smallest

   def compare_gender(self):

       total_movies_male = sum(student.movies for student in self.students if student.gender == 'M')

       total_movies_female = sum(student.movies for student in self.students if student.gender == 'F')

       if total_movies_male > total_movies_female:

           return "Male students watched more movies than female students."

       elif total_movies_male < total_movies_female:

           return "Female students watched more movies than male students."

       else:

           return "Both male and female students watched an equal number of movies."

# Create MovieStatistics object

statistics = MovieStatistics()

# Add students to the statistics

statistics.add_student(Student(20, 0, 'M'))

statistics.add_student(Student(21, 0, 'F'))

statistics.add_student(Student(19, 0, 'F'))

statistics.add_student(Student(22, 0, 'M'))

# Enter the number of movies for each student

statistics.enter_movies()

# Calculate statistics

average_movies = statistics.calculate_average()

largest_movies = statistics.find_largest()

smallest_movies = statistics.find_smallest()

gender_comparison = statistics.compare_gender()

# Display the statistics

print(f"Average number of movies watched: {average_movies}")

print(f"Largest number of movies watched: {largest_movies}")

print(f"Smallest number of movies watched: {smallest_movies}")

print(f"Gender comparison: {gender_comparison}")

In the above program, the Student class represents a college student and has properties such as age, number of movies watched, and gender.

The MovieStatistics class represents the statistical data gathering. It has methods to add students, enter the number of movies watched by each student, calculate the average, find the largest and smallest number of movies, and compare the total movie numbers between male and female students.

The program creates a MovieStatistics object, adds students to it, and then prompts the user to enter the number of movies watched by each student.

Finally, the program calculates and displays the average number of movies watched, the largest and smallest number of movies watched, and the gender comparison.

To capture screenshots of the output, you can run the program and take screenshots of the console window or terminal where the output is displayed.

You can learn more about Python program at

https://brainly.com/question/26497128

#SPJ11


Related Questions

For a context switch, the OS stores information of interrupted process. An OS designer decides to place such information a.) into registers, b.) memory, c.) or onto disk. Discuss pro and con of each option briefly. Which do you choose, and why

Answers

The options for storing the information of an interrupted process during a context switch are registers, memory, or disk. Each option has its pros and cons.

Storing the information in registers offers the fastest access time since registers are part of the CPU. However, the limited number of registers restricts the amount of information that can be stored. Storing the information in memory provides more storage capacity but has slower access times compared to registers. Additionally, memory can be more easily shared among multiple processes. Storing the information onto disk offers even larger storage capacity, but access times are significantly slower. Disk storage is commonly used for long-term storage of process information when it is swapped out of memory.

The choice of where to store the interrupted process information depends on various factors such as the system's design goals, hardware capabilities, and performance requirements. In most operating systems, a combination of memory and disk storage is used. The information is typically stored in memory during normal context switches for faster access, while some information may be swapped out to disk when memory becomes scarce. This approach provides a balance between speed and storage capacity, ensuring efficient context switching while utilizing available resources effectively.

To learn more about CPU  click here:

brainly.com/question/21477287

#SPJ11

what html tag that you were required to use for images on abp3 provides accessable descriptions of the images to jaws?

Answers

The ALT tag is known to be one of the HTML attribute used in HTML and XHTML documents. The html tag that you were required to use for images on abp3 provides accessable descriptions of the images to jaws is called an ALT tag

ALT tag is often used to bring out or soecify an alternative text that is to be used when the element to which it is applied cannot be used.

It is also known as ALT attribute and ALT description.

As an HTML attribute, it is often applied to image tags to provide a text alternative for search engines.

Learn more from

https://brainly.com/question/9068937

Users of a _____ database have access through their personal computers linked to local or wide area networks

Answers

Answer:

Company

Explanation:

A company database is a database of a firm or organization that contains the information about the firm's employees, their products, services, and as well their client's and customers' details.

This is often kept on the main database server and arranged and organized by a database administrator.

Hence, Users of a COMPANY database have access through their personal computers linked to local or wide area networks

Which of the following best describes today’s average gamer?

The average age is eighteen, and many more males play than females.
The average age is thirty, and only slightly more males play than females.
The average age is thirty, and many more males play than females.
The average age is eighteen, and only slightly more males play than females.

Answers

The correct answer is A

what is the extension of a Microsoft access database 2013​

Answers

Answer:

Access Database (2007, 2010, 2013, 2016)..accdb

Answer:

.accdb

Explanation:

.accdb is the extension of Microsoft Access Database 2013

Question 4 of 25
If an ad's job is to persuade us, our job is to:
O A. report the advertisers to government authorities.
B. see through its tactics and make an informed choice.
O C. feel happiness, excitement, sympathy, and fear.
O D. buy the products the advertisement is trying to sell.
SURMIT

Answers

Feel happiness, excitement, sympathy, and fear.

What is Persude?

Humans' reactions to events or circumstances, or their emotions, are known as emotions.

The situation that causes an emotion determines the kind of emotion that individual will feel. For instance, when someone hears excellent news, they are happy. When someone is in danger, they become afraid.

Our daily lives are significantly impacted by our emotions. Depending on our emotions—happiness, rage, sadness, boredom, or frustration—we make choices. We pick interests and pastimes based on the feelings they arouse.

Therefore, Feel happiness, excitement, sympathy, and fear.

To learn more about Emotions, refer to the link:

https://brainly.com/question/28464758

#SPJ1

you are a forensic investigator researching an email sent for malicious intent. the sender used an email web service to transmit the message. the receiver also used an email web service. both the sender and receiver deleted the message and then deleted the message from their trash folders. what is your only possible option to recover the email?

Answers

As a forensic investigator researching an email sent for malicious intent, your only possible option to recover the email is to issue a subpoena to the email web service provider and possibly recover the message from a backup.

This is because once the message is deleted from the trash folder, it is unrecoverable from the email client on either the sender or receiver machine.

Email web services typically store their users' data on servers, and these servers are backed up regularly to prevent data loss. However, the process of recovering the email from the backup will depend on the specific policies and procedures of the email web service provider.

It is important to note that the process of issuing a subpoena can be complex and time-consuming. It requires legal authorization, and the email web service provider may require a court order before releasing any data. Additionally, the provider may have limitations on how far back their backups go, so the chances of recovering the deleted email may be slim.

Overall, as a forensic investigator, it is crucial to work closely with legal counsel and adhere to proper procedures to ensure that any evidence obtained is admissible in court.
As a forensic investigator researching an email sent for malicious intent, where both the sender and receiver used email web services and deleted the message from their trash folders, your only possible option to recover the email is to issue a subpoena to the service provider and possibly recover the message from a backup.

Undeleting the email from the email clients on the sender or receiver machines would not be effective in this case, as both parties used web services and deleted the messages from their trash folders. Once the message is deleted from the trash folder, it is typically considered unrecoverable without external assistance such as obtaining a backup from the service provider through a subpoena.

Learn more about digital forensics. : https://brainly.com/question/26694391

#SPJ11

Your question is incomplete but probably the complete question is :

You are a forensic investigator researching an email sent for malicious intent. The sender used an email web service to transmit the message. The receiver also used an email web service. Both the sender and receiver deleted the message and then deleted the message from their trash folders. What is your only possible option to recover the email?

Undelete the email from the email client on the sender machine.

Undelete the email from the email client on the receiver machine.

Issue a subpoena to the service provider and possibly recover the message from a backup.

Once deleted from the trash folder, the message is unrecoverable.

ReadWorks.org
Assignments
Johnny's First Job

Answers

Answer:

reading and the gathered up to be in a Philippine language pilipino and see what they said it will send it s dark blue in a Philippine area is not what pic and I are going well with your grade now just need help now need help

what is a way to find a peaceful and agreeable solution when there's a disagreement. A. conflict resolution
B. active listening
C. leadership
D. non-verbal communication​

Answers

Answer:

A.) Conflict Resolution

Explanation:

Conflict resolution is when two or more parties work out a peaceful solution to a problem. Therefore the answer is A. I hope I helped! ^-^

Write a statement that creates a list of 7 school subjects

Answers

Answer:

math

science

english

art

pe

health

biology

Explanation:

Answer:

school_subjects = ["Math", "English", "Science", "History", "Physical Education", "Art", "Foreign Language"]

Jordan just wrote a secret message program in Python that converts the number 7,095 to 1s and 0s. Which number system is Jordan converting to?

A Binary
B Decimal
C Digital
D Hexadecimal

Answers

Answer:

binary

Explanation:

bi-two numbers doesnt meet reqiurments automatically considered 0

Answer:

Binary

Explanation:

i took the test

Look at the following Python code:
word1 = "Umpire"
print(word1[1])

Which character will be indexed from word1 and printed to the screen? (5 points)

1. U
2. m
3. p
4. i

Answers

Answer:

2. m

Explanation:

Computers count starting from 0 so 1 would actually be the 2nd letter

What is a function of Agile software development?

Answers

Agile software development refers to software development methodologies centered round the idea of iterative development, where requirements and solutions evolve through collaboration between self-organizing cross-functional teams.

a lw is to load register $5 from location 0x0040000c in memory. register $10 contains 0x00400000. write the assembly language instruction:

Answers

Assembly-language enables programmers to write code that corresponds to the machine instructions that a given processor may execute.

What kinds of instructions can you write in assembly language?

In an assembly language, program operations are defined by one of three types of instruction statements: Opcode abbreviations. Definitions of data. assembly resolutions.

What are the four fundamental components of instruction in assembly language?

Label, mnemonic, operand, and comment are its four component parts; not all of these are found in every line. The first component, in this case LOOP, is a label—a term the programmer created to designate this place in the program. The value of the address at which this instruction is stored will be used to set it.

To know more about Assembly-language visit:-

https://brainly.com/question/14728681

#SPJ4

You have 20 users who will be bringing their own mobile devices, tablets or laptops to connect to their work data. This will improve productivity, but they are concerned with what control they have over the users' access to corporate data. How will Windows 10 help the company manage users who bring their own devices?

Answers

More safe – When it comes to being infected by viruses and malware, Windows 10 is twice as secure as Windows 7 because it was created with security in mind. A deeper integration between Office 365 and OneDrive guarantees the security and portability of your data across numerous devices.

What Windows 10 help the company manage users?

They may quickly transition devices into a corporate-managed state from the cloud when you offer them Azure AD Join with automated Intune MDM enrolment.

Therefore, Your staff members can set up their own machines using Windows 10: They can set up corporate access with Azure AD join for corporate devices.

Learn more about Windows 10 here:

https://brainly.com/question/28847407

#SPJ1

Name the three types of filters available in Exel 2016​

Answers

Answer:by values, by a format, or by criteria.

Explanation:do you play nitro type to if you do lets play

The term 'aspect ratio' is a specification of ...
A. software.
B.
paper size.
C. printers.
D. monitors.
(1)

Answers

Answer:

I believe the correct aswer is D. Monitors

Explanation:

The aspect ratio of a display device is the proportional relationship between the width and the height of the display. It is expressed as two numbers separated by a colon (x:y), where x corresponds to the width and y to the height. Common aspect ratios for displays, past and present, include 5:4, 4:3, 16:10 and 16:9.

I hope that help!

The term 'aspect ratio' is a specification of ...A. software.B.paper size.C. printers.D. monitors.(1)

when a user provides a secret that is owned only by him or her, what type of authentication is being used?

Answers

The type of authentication being used when a user provides a secret that is owned only by them is "something you know" authentication.

Write two example use of relationships ICT

Answers

Answer:

Read it all before you write if this isn't what you searching for I'm sorry...:(

A relationship, in the context of databases, is a situation that exists between two relational database tables when one table has a foreign key that references the primary key of the other table. Relationships allow relational databases to split and store data in different tables, while linking disparate data items.

For example, in a bank database a CUSTOMER_MASTER table stores customer data with a primary key column named CUSTOMER_ID; it also stores customer data in an ACCOUNTS_MASTER table, which holds information about various bank accounts and associated customers. To link these two tables and determine customer and bank account information, a corresponding CUSTOMER_ID column must be inserted in the ACCOUNTS_MASTER table, referencing existing customer IDs from the CUSTOMER_MASTER table. In this case, the ACCOUNTS_MASTER table’s CUSTOMER_ID column is a foreign key that references a column with the same name in the CUSTOMER_MASTER table. This is an example of a relationship between the two tables.

Each device attached to a system can be represented by multiple device files.
TRUE OR False?

Answers

The statement is TRUE. Each device attached to a system can be represented by multiple device files.

In computer systems, device files are used to interact with devices connected to the system. A device file is a special file that represents a physical or virtual device and allows the operating system and applications to communicate with it.

Devices in a system can have multiple functionalities or different aspects that need to be accessed separately. Therefore, multiple device files can be associated with a single device. Each device file represents a specific aspect or functionality of the device.

For example, in Unix-like operating systems, the /dev directory contains device files that represent various devices. A device such as a disk drive may have different device files associated with it, such as /dev/sda for the whole disk, /dev/sda1 for the first partition, and /dev/sda2 for the second partition. Each device file allows different operations or access to different parts of the device.

Having multiple device files allows users and applications to interact with specific functionalities of a device individually, providing more flexibility and control over device operations. Therefore, the statement is true.

learn more about drive here:

https://brainly.com/question/28433908

#SPJ11

join each of the follwing sentences using unless

2. I will call the police. You will leave immediately ​

Answers

Explanation:

I will call the police, unless you leave immediately .

Answer:

hi

Explanation:

A positive static margin?

Answers

Answer:

whats this supposed to mean i cant help u >:(

Could you please be more specific I’m so confused but I’m more than happy to help! Thank you

six security issues and six descriptions are shown below.

six security issues and six descriptions are shown below.

Answers

Answer:

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

Explanation:

This question contains six securities terms and definitions.

The goal of this question is to properly map the term to its correct description/definition.

You can find the complete mapping in the attached image.

six security issues and six descriptions are shown below.

What does this loop that uses a range function do? for i in range(7, 15): print("goodbye") It prints "goodbye" 8 times, numbered from 7 through 14. It prints "goodbye" 9 times, numbered from 7 through 15. It prints "goodbye" 9 times. It prints "goodbye" 8 times.

Answers

Answer:

It prints "goodbye" 8 times.

Explanation:

The loop being described in this scenario would print "goodbye" 8 times. It would not include numbers detailing the range since the loop instructions only state for the system to print("goodbye") and nothing else. Also, it would only print it 8 times because in a range the endpoint is not included, this is mainly because in programming data structures tend to run on 0-based indexing.

Answer:

8 times is right

Explanation:

People are not interested in what you do _____. I think, more and more, they're not even really interested necessarily in how you look on paper, like a

Answers

Incomplete question. However, I inferred you are referring to the best word that likely completes the blank space.

Answer:

or don't do;

Explanation:

So, this statement could rightly read;

"People are not interested in what you do or don't. I think, more and more, they're not even really interested necessarily in how you look on paper, like a...."

Create a medical report for Wellness Hospital. Mention the hospital name as the heading and the report name as the subheading. The report should contain the details of all the medical specialists of the hospital, their degrees, and their specialty. Save and protect your document with a password. Write down the steps you took to complete this activity.

Answers

Some things to consider when preparing a medical report are:

Informed consent of the patientPhysical examinations of the patientBackground informationObtained specimensMedical history, etc.

What is a Medical Report?

This refers to the very detailed report that contains an account of a person's full clinical history.

Therefore, a sample medical report is given below:

Name of Hospital: Mellview HospitalAddress: 27, Hemingway Close, LondonGender: MaleName: Oscar PedrozoHIV test, Malaria test, High Blood Pressure, etc.

Read more about medical reports here:

https://brainly.com/question/21819443

#SPJ1

Create a medical report for Wellness Hospital. Mention the hospital name as the heading and the report

Children use audio-visual media to get hands-on experience and learn ______activities

Answers

Children use audio-visual media to get hands-on experience and learn interactive activities.

Audio-visual media, such as videos, animations, and interactive applications, provide children with a multi-sensory learning experience. These media allow children to engage with content through visual and auditory stimuli, enhancing their understanding and retention of information. Through audio-visual media, children can explore various interactive activities that stimulate their curiosity and promote active learning. They can participate in virtual experiments, simulations, problem-solving scenarios, and educational games that offer practical and immersive experiences. By actively engaging in these activities, children can develop critical thinking skills, enhance their creativity, and acquire knowledge in a more engaging and memorable way. The use of audio-visual media in education promotes a dynamic and interactive learning environment, fostering children's active participation and exploration of different subjects and concepts. It enables them to go beyond traditional textbook learning and provides opportunities for hands-on experiences that enhance their learning outcomes.

learn more about audio-visual media here:

https://brainly.com/question/9979289

#SPJ11

What it means to say media is a continuum, not a category?

Can someone help me with that real quick please?

Answers

It means that media exists along a spectrum with various degrees of characteristics, rather than being strictly defined by rigid categories.

What does such ideology of media being a continuum imply?

This perspective acknowledges the fluidity and overlapping nature of different media forms and their ever-evolving roles in communication, entertainment, and information dissemination.

As technology advances and media platforms continue to converge, the boundaries between traditional media categories (such as print, radio, television, and digital) become increasingly blurred. New forms of media often incorporate elements of existing forms, creating a continuous spectrum of media experiences.

Find more media related question here;

https://brainly.com/question/14047162

#SPJ1

to create a new column that stores the combination of the pick-up and drop-off location names, which function do you use?

Answers

Without a WHERE clause, a UPDATE statement will update every row in the table.

Update statement: what is it?

To change or update already-existing records in a table with SQL, use the UPDATE statement. Using the WHERE clause, you can either define a specific subset of entries to edit or use it to update everything at once. A SQL data manipulation command is the UPDATE statement.

Do update statements count as queries?

To modify a current entry or rows in the database, perform a UPDATE query. The rows in all tables can be changed by UPDATE queries, or we can use the WHERE clause to restrict the rows that an update statement affects. To update the data, we typically employ constant values, such as the following structures.

To know more about UPDATE statement visit;

https://brainly.com/question/14271783

#SPJ4

A DMA module is transferring characters to memory using cycle stealing, from a device transmitting at 9600 bps. The processor is fetching instructions at the rate of 1 million instructions per second (1 MIPS). By how much will the processor be slowed down due to the DMA activity?

Answers

The processor will be slowed down by approximately 10% due to the DMA activity.

To determine the slowdown caused by the DMA activity, we need to calculate the time taken by the DMA module to transfer characters to memory and compare it to the time available for the processor to fetch instructions.

The DMA module is transferring characters at a rate of 9600 bps (bits per second). To convert this to bytes per second, we divide by 8 since there are 8 bits in a byte. Therefore, the DMA module transfers characters at a rate of 1200 bytes per second (9600/8).

Now, let's calculate the time taken by the DMA module to transfer one character: 1/1200 seconds (since it transfers 1200 characters per second).

The processor fetches instructions at a rate of 1 million instructions per second (1 MIPS). Each instruction takes a certain number of cycles to execute, which we'll assume as 1 cycle for simplicity.

So, the time available for the processor to fetch instructions is 1/1,000,000 seconds per instruction.

Comparing the time taken by the DMA module (1/1200 seconds per character) to the time available for the processor (1/1,000,000 seconds per instruction), we can see that the processor is slowed down by approximately 10% due to the DMA activity (1/1200 divided by 1/1,000,000 equals 0.00833, which is approximately 10%).

To learn more about  characters  Click Here: brainly.com/question/29760943

#SPJ11

Other Questions
Which type of line and direction of shading does y > tell you? In 2022, Eric's filing status is Head of Household. Eric has $50,000 of adjusted gross income and $15,500 in itemized deductions. Eric's taxable income is: PLEASE HELP!Which statement would Napoleon Bonaparte most likely agree with?A: The people have a right to overthrow an ineffective government.B: The best government is one that limits its rulers power.C: An effective ruler should be ready for war, but not seek war.D: Each nation has a right to govern itself independently. helpppppppppppppppppp What is the practice theory of play? stream hot sauce by nct dream lolzies Suppose that the government is concerned that an electric utility company is taking advantage of consumers with unfair pricing policies. The government views electricity as a public good that is likely to be produced inefficiently by the private sector. Which of the following policy options might most effectively enable the government to achieve its objectives in this situation? a. Regulate the pricing behavior. b. Turn the company into a public enterprise. c. Use the law to increase competition.d. Do nothing at all. Stopping isn't always the safest thing to do in an emergency. what can be the meaning of social health. Which group of immigrants DID NOT experience discrimination A. Irish B. ItaliansC. Chinese D. English Can someone help me please Someone plz help me with this problem: An elevator ascends from rest with an acceleration of 0.6 ms^2 before slowing down with a decelleration of 0.8 ms^2 for the next stop. The total time taken is 10 seconds. Find the distance between the stops. The answer is 17.1 but I dont understand how to get it . Dont answer if you dont know or I will report you. If each customer takes 3 minutes to check out, what is the probability that it will take more than 6 minutes for all the customers currently in line to check out? The probability that it will take more than 6 minutes for all the customers currently in line to Which of the following statements concerning ring satellites of the planets is true? A) They are thin, solid disks revolving around the parent planets in polar orbits B) They consist of concentrations of particles generally smaller than 10 meters in diameter C) They have orbits that do not coincide with the equatorial planes of the parent planets D) They are present around Saturn and Jupiter, but not around Uranus and Neptune. which of the following are true about the amortization of a fixed payment loan? multiple select question. the amount of interest paid decreases each period. the payment amount decreases each period. the amount of interest and principal paid increases each period. the principal amount paid increases each period. -1/3x-4/3y=-2 1/3x-2/3y=4 using elimination Intelligence test.If you get it right ,you are a critical thinker.You were in the garden, there are 34 people in the yard. You killed 30 .How many people are in the garden.I What is a common complication that results from immobilization of or lack of use of a muscle. Were humans supposed to get this or was it a mistake? Does anyone know this answer?