Write a demo test to verify the above Rectangle object accessible from demo test main program and can execute display() method to output.

Answers

Answer 1

Answer:

Explanation:

The Rectangle class was not provided in this question but after a quick online search I was able to find the class code. Due to this I was able to create a test code in the main Method of my program to create a Rectangle object and call it's display() method. The Test code and the output can be seen in the attached image below. While the code below is simply the Main Test Program as requested.

class Brainly {  

   public static void main(String[] args) {

       Rectangle rectangle = new Rectangle(20, 8);

       rectangle.display();

   }

}


Related Questions

Which support function under Tech Mahindra is governing data privacy and protection related requirements

Answers

Answer:

Privacy Policy

Explanation:

PRIVACY POLICY is the support function under Tech Mahindra that is governing data privacy and protection-related requirements.

Given that support functions are functions which assist and in a way contribute to the company goal.

Other support functions are human resources, training and development, salaries, IT, auditing, marketing, legal, accounting/credit control, and communications.

The above statement is based on the fact that the Privacy Policy clarifies all the data protection rights, such as the right to object to some of the production processes that TechM may carry out.

Select the correct answer.
Which of these statements is true of dynamic design diagrams?
A.
They demonstrate objects.
B.
They demonstrate relationships.
C.
They demonstrate the behavior of system aspects.
D.
They include structure diagrams.

Answers

Answer:

They demonstrate the behavior of system aspects.

The statement true regarding the dynamic design diagram is that it demonstrates the behavior change in the system. Thus, option C is correct.

What is a dynamic design diagrams?

A dynamic design diagram is given as the model that has been expressing the development of the operations, actions, and the behavior of the system over time.

The dynamic design diagram is thereby the demonstration of the behavior of system aspects. Thus, option C is correct.

Learn more about dynamic design, here:

https://brainly.com/question/14956129

#SPJ2

Explain how you would find a book on a given subject in the library.

Answers

Answer:

In case I am looking for a specific book in a library, the way in which I would try to find it would be through consulting the library guide, or through inspection of the different books of the specific sector with which the book I'm looking for is listed, or by asking the library staff to help me with my search.

what is operating system?

Answers

Answer:

operating system (os)is translator between the operator (user)and the computer

Operating system (OS) is the low-level software that supports a computer's basic functions, such as scheduling tasks and controlling peripherals.

Suppose you have some List of S List of Strings called List and a String prefix. Write a method that removes all the Strings from list that begin with prefix. public void removePrefixStrings(List-String- list, String prefix) 7. What is the time complexity of this algorithm?

Answers

Answer:

public void removePrefixStrings(List<String> list , String prefix) {

if(list==null || list.size()==0)

return;

for(int i=0; i<list.size();) {

if(list.get(i).startsWith(prefix))

list.remove(i);

else

++i;  

}  

}  

Time Complexity: If the prefix is the same as String length, Then finding all prefix match will take n *n = n2

Then removal is also n  

So the total time complexity is O(n3)

When an external device becomes ready to be serviced by the processor the device sends a(n)_________ signal to the processor.

Answers

when an external device becomes ready to be serviced by the processor the device sends a(n) interrupt signal to the processor

You work as the IT Administrator for a small corporate network you need to configure configure the laptop computer in the Lobby to use the corporate proxy server. The proxy server is used to control access to the internet. In this lab, your task is to configure the proxy server settings as follows: Port: 9000

Answers

Answer:

okay if I am it administration I will port 10000

To configure the computer in the lobby to use the corporate proxy server, you will need to follow these steps:

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

What is Proxy Server?

A proxy server is a device or router that acts as a connection point between users and the internet.

Proxy Server settings would be the same for both Wifi and Ethernet connections, explaining about the configuration in Windows Operating System.

Open the internet browser on the laptop and go to the settings or preferences page. The exact location of the proxy settings will vary depending on the browser you are using.

In the settings or preferences page, look for the "Proxy" or "Network" section.

In the proxy settings, select the option to use a proxy server.

Enter the address of the corporate proxy server in the "Server" or "Address" field.

Enter the port number "9000" in the "Port" field.

Save the changes and close the settings or preferences page.

Test the proxy server configuration by attempting to access a website. If the configuration is correct, the laptop should be able to access the internet through the proxy server.

Settings > Networks&Internet > Proxy > Manual Proxy Setup > Address & proxy > save

To learn more about the Proxy Server settings click here:

https://brainly.com/question/14403686

#SPJ12

Write a program that asks the user to enter 5 test scores. The program will display a letter grade for each test score and an average grade for the test scores entered. Three functions are needed for this program.

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

double average(double s1, double s2, double s3, double s4, double s5){

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

   return avg;}

char lGrade(double score){

   char grade;

   if(score>= 90 && score <= 100){ grade ='A'; }

   else if(score>= 80 && score <= 89){ grade ='B'; }

   else if(score>= 70 && score <= 79){ grade ='C'; }

   else if(score>= 60 && score <= 69){ grade ='D'; }

   else if(score < 60){ grade ='F'; }

   return grade;}

int main(){

   double s1,s2,s3,s4,s5;

   cin>>s1>>s2>>s3>>s4>>s5;

   double avg = average(s1,s2,s3,s4,s5);

   cout<<s1<<" "<<lGrade(s1)<<endl;

   cout<<s2<<" "<<lGrade(s2)<<endl;

   cout<<s3<<" "<<lGrade(s3)<<endl;

   cout<<s4<<" "<<lGrade(s4)<<endl;

   cout<<s5<<" "<<lGrade(s5)<<endl;

   cout<<avg<<" "<<lGrade(avg)<<endl;

   return 0;}

Explanation:

The three functions to include in the program are not stated; so, I used the following functions in the program

1. The main function

2. average function

3. Letter grade function

The average function begins here

double average(double s1, double s2, double s3, double s4, double s5){

This calculates the average

   double avg = (s1 + s2 + s3 + s4 + s5)/5;

This returns the calculated average

   return avg;}

The letter grade function begins here

char lGrade(double score){

This declares the grade

   char grade;

If score is between 90 and 100 (inclusive), grade is A

   if(score>= 90 && score <= 100){ grade ='A'; }

If score is between 00 and 89 (inclusive), grade is B

   else if(score>= 80 && score <= 89){ grade ='B'; }

If score is between 70 and 79 (inclusive), grade is C

   else if(score>= 70 && score <= 79){ grade ='C'; }

If score is between 60 and 69 (inclusive), grade is D

   else if(score>= 60 && score <= 69){ grade ='D'; }

If score is less than 60, grade is F

   else if(score < 60){ grade ='F'; }

This returns the calculated grade

   return grade;}

The main begins here

int main(){

This declares the 5 scores

   double s1,s2,s3,s4,s5;

This gets input for the 5 scores

   cin>>s1>>s2>>s3>>s4>>s5;

This calls the average function for average

   double avg = average(s1,s2,s3,s4,s5);

This calls the letter grade function for the 5 scores

   cout<<s1<<" "<<lGrade(s1)<<endl;

   cout<<s2<<" "<<lGrade(s2)<<endl;

   cout<<s3<<" "<<lGrade(s3)<<endl;

   cout<<s4<<" "<<lGrade(s4)<<endl;

   cout<<s5<<" "<<lGrade(s5)<<endl;

This calls the average function for the average

   cout<<avg<<" "<<lGrade(avg)<<endl;

Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented here. Write a program called primes.js that implements this algorithm. Have the program find and display all the prime numbers up to n = 150

Answers

Answer:

Explanation:

The following code is written in Javascript and is a function called primes that takes in a single parameter as an int variable named n. An array is created and looped through checking which one is prime. If So it, changes the value to true, otherwise it changes it to false. Then it creates another array that loops through the boolArray and grabs the actual numberical value of all the prime numbers. A test case for n=150 is created and the output can be seen in the image below highlighted in red.

function primes(n) {

   //Boolean Array to check which numbers from 1 to n are prime

   const boolArr = new Array(n + 1);

   boolArr.fill(true);

   boolArr[0] = boolArr[1] = false;

   for (let i = 2; i <= Math.sqrt(n); i++) {

      for (let j = 2; i * j <= n; j++) {

          boolArr[i * j] = false;

      }

   }

   //New Array for Only the Prime Numbers

   const primeNums = new Array();

  for (let x = 0; x <= boolArr.length; x++) {

       if (boolArr[x] === true) {

           primeNums.push(x);

       }

  }

  return primeNums;

}

alert(primes(150));

hãy giúp tôi giảiiii​

Answers

Answer:

fiikslid wugx uesbuluss wuz euzsbwzube

Question: Name the person who originally introduced the idea of patterns as a solution design concept.

Answers

Answer:

architect Christopher Alexander is the person who originally introduced the idea of patterns as a solution design concept.

The person who originally introduced the idea of patterns as a solution design concept named as Christopher Alexander who was an architect.

What is architecture?

Architecture is referred to as an innovative technique or artwork based on buildings or physical structures that aims at creating cultural values for upcoming generations to understand the importance of history.

The external layout can be made to best support human existence and health by using a collection of hereditary solutions known as the "pattern language." It creates a set of helpful relationships by combining geometry and social behavior patterns.

Christopher Alexander, a British-American engineer and design theorist of Austrian heritage, is renowned for his several works on the design and construction process introduced the idea of patterns as a solution design concept.

Learn more about pattern language architecture, here:

https://brainly.com/question/4114326

#SPJ6

1) Declare an ArrayList named numberList that stores objects of Integer type. Write a loop to assign first 11 elements values: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. Do not use Math.pow method. Assign first element value 1. Determine each next element from the previous one in the number List. Print number List by using for-each loop.

Answers

Answer:

Explanation:

The following is written in Java and uses a for loop to add 10 elements to the ArrayList since the first element is manually added as 1. Then it calculates each element by multiplying the previous element (saved in count) by 2. The program works perfectly and without bugs. A test output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly {

   public static void main(String[] args) {

       ArrayList<Integer> numberList = new ArrayList<>();

       numberList.add(0, 1);

       int count = 1;

       for (int i = 1; i < 11; i++) {

           numberList.add(i, (count * 2));

           count = count * 2;

       }

       for (Integer i : numberList) {

           System.out.println(i);

       }

   }

}

Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of job. It also maintains a file of estimates given for jobs not yet performed; this file contains a customer number, name, address, proposed date of job, and proposed price. Each file is in customer number order.

Required:
Design the logic that merges the two files to produce one combined file of all customers whether past or proposed with no duplicates; when a customer who has been given an estimate is also a past customer, use the proposed data.

Answers

Answer:

Hre the complete implementation of python code that reads two files and merges them together.

def merge_file(past_file_path,proposed_file_path, merged_file_path):

   past_file_contents=load_file(past_file_path)

   proposed_file_contents=load_file(proposed_file_path)

   proposed_customer_name = []

   for row in proposed_file_contents:

       proposed_customer_name.append(row[1])

   with open(merged_file_path,'w') as outputf:

       outputf.write("Customer Number, Customer Name, Address\r\n")

       for row in proposed_file_contents:

           line = str(row[0]) +", " + str(row[1]) + ", " + str(row[2]) +"\r\n"

           outputf.write(line)

       for row in past_file_contents:

           if row[1] in proposed_customer_name:

               continue

           else:

               line = str(row[0]) + ", " + str(row[1]) + ", " + str(row[2]) + "\r\n"

               outputf.write(line)

       print("Files merged successfully!")

# reads the file and returns the content as 2D lists

def load_file(path):

   file_contents = []

   with open(path, 'r') as pastf:

       for line in pastf:

           cells = line.split(",")

           row = []

           for cell in cells:

               if(cell.lower().strip()=="customer number"):

                   break

               else:

                   row.append(cell.strip())

           if  len(row)>0:

               file_contents.append(row)

   return file_contents

past_file_path="F:\\Past Customer.txt"

proposed_file_path="F:\\Proposed Customer.txt"

merged_file_path="F:\\Merged File.txt"

merge_file(past_file_path,proposed_file_path,merged_file_path)

Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the array. Then, fill the array with values using the pointer (Note: Do NOT use the array name.). Enhance the program by prompting the user for the values, again using the pointer, not the array name. Use pointer subscript notation to reference the values in the array.

Answers

Answer:

#include<iostream>

using namespace std;

int main()

{

  int a[20],n;

  int *p;

  cout<<"\n enter how many values do you want to enter:";

  cin>>n;

  for(int i=0;i<n;i++)

  {

      cout<<"\n Enter the "<<i+1 <<"th value :";

      cin>>*(p+i);

      //reading the values into the array using pointer

  }

  cout<<"\n The values in the array using pointer is:\n";

  for(int i=0;i<n;i++)

  {

      cout<<"\n (p+"<<i<<"): "<<*(p+i);

      //here we can use both *(p+i) or p[i] both are pointer subscript notations

  }

}

Output:

A business should choose the platform as a service (PaaS) cloud model when: a. it designs its own applications but doesn't customize the operating system b. it doesn't need any operating system c. it doesn't design its own applications and doesn't customize the operating system d. it designs its own applications and customizes the operating system e. it doesn't design its own applications but customizes the operating syste

Answers

Answer:

a. it designs its own applications but doesn't customize the operating system.

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models and these are;

1. Infrastructure as a Service (IaaS).

2. Software as a Service (SaaS).

3. Platform as a Service (PaaS).

Platform as a Service (PaaS) refers to a type of cloud computing model in which a service provider makes available a platform that allow users (software developers) to build code (develop), run, store information in a database and manage applications over the internet.

The main purpose of a Platform as a Service (PaaS) is to provide an enabling environment for software developers to code without having to build and maintain complex infrastructure needed for the development, storage and launching of their software applications.

Simply stated, PaaS makes provision for all of the software and hardware tools required for all the stages associated with application development over the internet (web browser).

Some of the advantages of Platform as a Service (PaaS) is that, it avails software developers with enough convenience as well as simplicity, service availability, ease of licensing and reduced costs for the development of software applications.

Basically, platform as a Service (PaaS) providers (vendors) usually provide their clients (software developers) with server and data storage, operating system, data center, networking resources, etc., while the software developers design, deploy and manage their software applications.

Hence, a business should choose the platform as a service (PaaS) cloud model when it designs its own applications but doesn't customize the operating system.

What does the AVERAGE function calculate? the total sum of a list of values the arithmetic mean of a list of values the total number of values in a list the percentage of values in a list

Answers

Answer:

B) the arithmetic mean of a list of values

Explanation:

on Edge

The Average function calculates the arithmetic mean of a list of values. Therefore, option B is the correct option.

What is the average?

In its most general definition, an average can be considered as the representative number or figure from the whole list. The average of a list containing multiple values is obtained by adding all the values and dividing them up by the total number of values.

The ultimate objective of calculating the average is to discover the value that represents the whole list. Average is also known as mean, and it works as a central value in the list, which is comprehensive in nature. It works as an approximate or rough estimate, which helps us in making decisions in daily life.

Thus, the average function calculates the arithmetic mean of a list of values. Therefore, option B is the correct option.

To learn more about the average, visit the link below:

https://brainly.com/question/11265533

#SPJ2

rules used in naming variables in object oriented programming​

Answers

Answer:

Explanation: Name your variables based on the terms of the subject area, so that the variable name clearly describes its purpose.

What should businesses do in order to remain competitive under the current Cloud
landscape?

Answers

Answer:

Cloud Landscape

They must evangelize the benefits of cloud computing to company executives in order to assist them in developing and extracting business benefits that will give them a competitive advantage and increase profits

Explanation:

The most successful organisations carefully plan out a multiyear effort to improve their cloud adoption, focusing on multiple streams of work across several stages of maturity.

Cloud computing governance is difficult even when only one cloud provider is involved, and it becomes even more difficult as organisations move toward multi cloud.

Continuous workload placement analysis involves reassessing workloads at a regular cadence, evaluating whether the current execution venue sufficiently meets the organization’s needs and if migrating to an alternative model provides higher value without adding significant risk to the organization’s operations

They must evangelize the benefits of cloud computing to company executives in order to assist them in developing and extracting business benefits that will give them a competitive advantage and increase profits.

In this question, the response is "Cloud Landscape" which can be defined as follows:

The organizations should adopt these new technologies to benefit from the digital transformation offered by the cloud.New enterprises were embracing cloud computing management strategies, placing established companies at risk.In the multi-year efforts for improving cloud security were meticulously planned by even the most successful enterprises. In several contributing to higher at various maturity levels are addressed.The multi-cloud plan enables governance of cloud computing increasingly challenging, even and there is only one cloud service provider involved in the agreement.  

Learn more:

cloud computing: brainly.com/question/16026308

A small e-commerce company uses a series of Robotic Process Automation solutions to manage the backup of data from individual workstations to an on-premise server. However, the company is opening another office and would like to more easily share data between locations, along with better protecting the data from loss.
Which technology could be combined with their current automated processes to do this?

Answers

Answer:

Cloud.

Explanation:

Cloud computing can be defined as a form of data computing which requires the use of shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offer individuals and businesses a fast, secured, effective and efficient way of providing services over the internet.

Basically, cloud computing comprises three (3) service models and these include;

1. Platform as a Service (PaaS).

2. Software as a Service (SaaS).

3. Infrastructure as a Service (IaaS).

Additionally, the two (2) main characteristics of cloud computing are;

I. Measured service: it allows cloud service providers to monitor and measure the level of service used by various clients with respect to subscriptions.

II. Resource pooling: this allows cloud service providers to serve multiple customers or clients with services that are scalable and provisional.

For example, the provisioning of On-demand computing resources such as storage, network, virtual machines (VMs), etc., so as to enable the end users install various software applications, database and servers.

Hence, the technology that could be combined by the small e-commerce company with its current automated processes is cloud storage.

There are different tools used in data sharing. The technology that could be combined with their current automated processes to do this is blockchain.

Blockchain is known to use different kinds of distributed ledger that is often shared across networked devices. Through this, people on the network can share files and values securely and even on a peer-to-peer basis. This is no need any middlemen.

Data protected in blockchain is very vital.  All records on a blockchain are known too be secured through the act of cryptography. Here, Network people do have their own private keys that are given to them for any  transactions they make.

Learn more about Blockchain from

https://brainly.com/question/25700270

In the revised version of the library system with Book and Periodical, Question 16 options: a) Book is a subclass of Periodical b) Periodical is a subclass of Book c) Book and Periodical are subclasses of LoanableItem d) Book and Periodical implement LoanableItem

Answers

Answer:

c. Book and Periodical are subclasses of LoanableItem

Explanation:

Books are kept in library in a periodical manner. Both classes are not superior, they are subclasses of LoanableItem. Library uses common guide which makes it easy to find a book.

When a Select Case statement executes, the value of the test expression is compared with the values that follow each of the _______ keywords.

Answers

Answer:

Case

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

A Select Case statement can be defined as a conditional statement that avails software developers or programmers the ability to test a variable by comparing it with a list of values.

In a Select Case statement, each variable is referred to as a Case.

Generally, when a Select Case statement executes, the value of the test expression is compared with the values that follow each of the Case keywords.

15) Three primary activities of a program are: A) Variables, Operators, and Key Words B) Lines, Statements, and Punctuation C) Input, Processing, and Output D) Integer, Floating-point and Character E) None of the above​

Answers

Answer:

yes sir

Explanation:

Write a method rearrange that takes a queue of integers as a parameter and rearranges the order of the values so that all of the even values appear before the odd values and that otherwise preserves the original order of the list. For example, suppose a queue called q stores this sequence of values: front [3, 5, 4, 17, 6, 83, 1, 84, 16, 37] back Then the call of rearrange(q); should rearrange the queue to store the following sequence of values: front [4, 6, 84, 16, 3, 5, 17, 83, 1, 37] back Notice that all of the evens appear at the front of the queue followed by the odds and that the order of the evens is the same as in the original list and the order of the odds is the same as in the original list. You may use one stack as auxiliary storage.

Answers

Answer:

i got the answer

Explanation:

hope you can too

In cell K8, create a formula using the SUM function that calculates the total of the range D17:D20 and subtracts it from the value in cell J8.

Answers

Answer:

so like what are you asking for so i can help u just tell me what u need and i will help u :)

Explanation:

Write a program that asks a user to enter a date in month day year format (for example 10 12 2016) and displays the day of the week for that date, in this case, Wednesday.

Answers

Answer and Explanation:

Using javascript:

function dayof_theweek(){

var TodayDate = window. prompt("enter today's date in the format 'year, month, day' ");

var Datenow=new date(TodayDate);

var Dayofweek=Datenow.getday();

var Days=["monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];

if(Dayofweek==indexOf(Days[Dayofweek]))

{

document.createTextnode(Days[Dayofweek]);

}

}

The program above uses a date object which uses the method getday to get the day of the week(get day returns an integer from 0 to 6).we then use a comparison operator == to test the condition that returned value Dayoftheweek is same with the index of the array Days and then print to a html document. The program may need improvements such as the fact that errors may arise when proper input isn't given, and therefore must be handled.

Write a C++ program that takes a single character and prints the corresponding digit on the old-style dial or touchtone telephone keypad, if it exists, or a message stating that the character does not correspond to a digit on the keypad.

Answers

Ok thanks Ianswer: c++

Implementing HTML best practices and writing code to match the original intentions of each element is known as __________ HTML. standard attribute-based industry semantic

Answers

Answer:

semantic

Explanation:

The description provided is describing the practice known as semantic HTML. This is basically code that provides both the user and the developer a description on what the code was originally supposed to do. For example, a method that calculates the total cost of a set of prices could be called calculateTotal(). By doing so you are describing the intention of the method clearly so that the individual using the method does not need to look at anything else to know what it does.

Implementing HTML best practices and writing code to match the original intentions of each element is known as __________ HTML.

Semantic

Based on the knowledge of semantics HTML which is a programming language used to write codes for the building blocks of any website, it gives the user and programmer the details of what the code is supposed to perform.

Furthermore, this helps them to match the original intentions of the code which helps in understanding of the code which also helps with debugging.

Therefore, the correct answer is semantic

Read more about HTML practises here:

https://brainly.com/question/19117781

ITING THE ANSWER
1. According to Turner and Wilson (2018), Information Literacy consists of
tasks EXCEPT...
A applying previous knowledge.
C. finding appropriate information
B. determining information need.
2. Outlining your problem, developing research questions, selecting keywords a
developing concept charts are activities during...
D. using information ethically
A. communicating information.
B. determining information need.
C. evaluating search results.
D. finding appropriate resources,
3. Asking questions such as what, why, where and how is an effective way to
A. craft your research questions.
B. develop good keywords
C. find good information
D. understand your topic,
4. In asking "what" questions, you intend to find...
A. answers and solutions.​

Answers

Answer:

Answer my first question

H0: Protype design has at most 37mpg vs. HA: prototype design has greater than 37mpg. If H0 is rejected, the action will be move the protype deisgn to prpduction. What kind of test is required

Answers

Answer:

A one-tailed test with upper reject region

Explanation:

H0 : μ ≤ 37

H1 : μ > 37

This is a right tailed tailed test as indicated by the greater than symbol on the hypothesis defined. Hence, the critical region will lie to the right of the area under the curve.

Critical region which lies to the right of the curve is called the upper rejection region.

Rejecting the Null, H0 means that ; the value of the test statistic exceeds the critical value;

When the hypothesis is declared with the less than sign, rejection region lies to the left or lower region.

While a two tailed test has rejection region shares between each tail.

The Marietta Country Club has asked you to write a program to gather, then display the results of the golf tournament played at the end of March. The Club president Mr. Martin has asked you to write two programs.
The first program will input each player's first name, last name, handicap and golf score and then save these records in a file named golf.txt (each record will have a field for the first name, last name, handicap and golf score).
The second program will read the records from the golf.txt file and display them with appropriate headings above the data being displayed.
If the score is = Par, then display 'Made Par'
If the score is < Par, then display 'Under Par'
If the score is > Par, then display 'Over Par'
There are 16 players in the tournament. Par for the course is 80. The data is as follows:
Andrew Marks 11.2 72
Betty Franks 12.8 89
Connie William 14.6 92
Donny Ventura 9.9 78
Ernie Turner 10.1 81
Fred Smythe 8.1 75
Greg Tucker 7.2 72
Henry Zebulon 8.3 83
Ian Fleming 4.2 72
Jan Holden 7.7 84
Kit Possum 7.9 79
Landy Bern 10.3 93
Mona Docker 11.3 98
Kevin Niles 7.1 80
Pam Stiles 10.9 87
Russ Hunt 5.6 73

Answers

Answer:

Explanation:

The following program is written in Python. It creates two functions, one for writting the players and their scores to the file, and another function for reading the file and outputting whether or not they made Par. The functions can be called as many times that you want and the writeFile function allows for 16 inputs to be made when called. A test case has been provided with all of the players mentioned in the question. The output can be seen in the attached image below.

def writeFile():

   file = open('output.txt', 'w')

   for x in range(16):

       firstName = input("Enter First Name:")

       lastName = input("Enter Last Name:")

       handicap = input("Handicap:")

       score = input("Score:")

       file.write(str(firstName) + " " + str(lastName) + " " + str(handicap) + " " + str(score) + "\n")

   file.close()

def readFile():

   file = open('output.txt', 'r')

   for line in file:

       lineArray = line.split(" ")

       if int(lineArray[-1]) < 80:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Under Par" )

       elif int(lineArray[-1]) == 80:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Made Par")

       else:

           print(str(lineArray[0]) + " " + str(lineArray[1]) + " Over Par")

   file.close()

writeFile()

readFile()

Other Questions
PLZ I NEED SOON!!!Ethan began making a model to show the processes which resulted in the formation of oceans Which of the following would be the next step in the process?Crust is broken downEarths crust movesEarths plates meetSea floor spreading Please helppppp!!!!!!!! How to do questions 19 and 20 A group of dental researchers are testing the effects of acidic drinks on dental crowns. They have five containers of crowns labeled V, W, X, Y, and Z. They will randomly select one of the containers to be the control for the experiment by drawing one of five well-mixed slips of paper with the same labels from a hat. Which of the following is the probability model for the control container? 2z^8- 32z^8 Help plz are amino acids associated with proteins plz match the following what is the slope intercept equation of the line below? When purchases of merchandise are made on account with a perpetual inventory system, the transaction is recorded with which entry What is the moral message from the story of the examination day A party rental company has chairs and tables for rent. The total cost to rent 2 chairs and 5 tables is $53. The total cost to rent 8 chairs and 3 tables is $42. What is the cost to rent each chair and each table? Some athletes choose to use supplements and performance-enhancing drugs in hopes of gaining an edge over their opponents. Research and describe at least three risks of using anabolic steroids and other performance-enhancing drugs. Complete the chart with your findings. Tell me about 1 drug, alcohol, and tobacco. This is the chart: Risk Description Link to Source Risk Description Link to Source Risk Description Link to Source 1. Ojal que t siempre ____ en forma.2. Ojal que (yo) ___ en forma antes de ir a la playa.3. Ojal que Manolo ____ un poco. Est nut gordito. Could Anyone explain me the difference between the two1."Could They have Won the match if they Performed a bit better?"2."."Could They have Won the match if they had Performed a bit better?" Can some one help me solve these 3 questions? SECTION BA matatu and Nissan left town A for town B 240km away at 8.00 a.m travelling at 90km/hrand 120km/hr respectively. After 20 minutes the Nissan had a puncture which took 30minutes to mend.(5mksa) How far from town A did the Nissan catch up with the matatu? Which of these is an essential part of active reading? In the context of this story, how does fear drive action? Discuss the consequences of Rodericks fear and paranoia. Investigar: Qu es la factura?Qu es la Nota de venta?En que momento se usa la factura?En que momento se usa la nota de venta?Por qu el bazar del barrio no da factura ni nota de venta?CONVERSE CON EL SEOR DEL BAZAR DE SU BARRIO PARA CONOCER QUE DOCUMENTOS DEBE TENER PARA QUE EL FUNCIONAMIENTO DE SU NEGOCIO SEA LEGAL Y CORRECTO A 12.0 g sample of gas occupies 19.2 L at STP. what is the of moles and molecular weight of this gas?