Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. The input file contains an unsorted list of number of seasons followed by the corresponding TV show. Your program should put the contents of the input file into a dictionary where the number of seasons are the keys, and a list of TV shows are the values (since multiple shows could have the same number of seasons).
Sort the dictionary by key (least to greatest) and output the results to a file named output_keys.txt, separating multiple TV shows associated with the same key with a semicolon (;). Next, sort the dictionary by values (alphabetical order), and output the results to a file named output_titles.txt.
Ex: If the input is:
file1.txt
and the contents of file1.txt are:
20
Gunsmoke
30
The Simpsons
10
Will & Grace
14
Dallas
20
Law & Order
12
Murder, She Wrote
the file output_keys.txt should contain:
10: Will & Grace
12: Murder, She Wrote
14: Dallas
20: Gunsmoke; Law & Order
30: The Simpsons
and the file output_titles.txt should contain:
Dallas
Gunsmoke
Law & Order
Murder, She Wrote
The Simpsons
Will & Grace
Note: There is a newline at the end of each output file, and file1.txt is available to download.
currently, my code is:
def readFile(filename):
dict = {}
with open(filename, 'r') as infile:
lines = infile.readlines()
for index in range(0, len(lines) - 1, 2):
if lines[index].strip()=='':continue
count = int(lines[index].strip())
name = lines[index + 1].strip()
if count in dict.keys():
name_list = dict.get(count)
name_list.append(name)
name_list.sort()
else:
dict[count] = [name]
return dict
def output_keys(dict, filename):
with open(filename,'w+') as outfile:
for key in sorted(dict.keys()):
outfile.write('{}: {}\n'.format(key,';'.join(dict.get(key))))
print('{}: {}\n'.format(key,';'.join(dict.get(key))))
def output_titles(dict, filename):
titles = []
for title in dict.values():
titles.extend(title)
with open(filename,'w+') as outfile:
for title in sorted(titles):
outfile.write('{}\n'.format(title))
print(title)
def main():
filename = input()
dict = readFile(filename)
if dict is None:
print('Error: Invalid file name provided: {}'.format(filename))
return
output_filename_1 ='output_keys.txt'
output_filename_2 ='output_titles.txt'
output_keys(dict,output_filename_1)
print()
output_titles(dict,output_filename_2)
main()
The problem is that when I go to submit and the input changes, my output differs.
Output differs. See highlights below. Special character legend Input file2.txt Your output 7: Lux Video Theatre; Medium; Rules of Engagement 8: Barney Miller;Castle; Mama 10: Friends; Modern Family; Smallville;Will & Grace 11: Cheers;The Jeffersons 12: Murder, She Wrote;NYPD Blue 14: Bonanza;Dallas 15: ER 20: Gunsmoke; Law & Order; Law & Order: Special Victims Unit 30: The Simpsons Expected output 7: Rules of Engagement; Medium; Lux Video Theatre 8: Mama; Barney Miller; Castle 10: Will & Grace; Smallville; Modern Family; Friends 11: Cheers; The Jeffersons 12: Murder, She Wrote; NYPD Blue 14: Dallas; Bonanza 15: ER 20: Gunsmoke; Law & Order; Law & Order: Special Victims Unit 30: The Simpsons

Answers

Answer 1

Answer:

Explanation:

The following is written in Python. It creates the dictionary as requested and prints it out to the output file as requested using the correct format for various shows with the same number of seasons.The output can be seen in the attached picture below.

mydict = {}

with open("file1.txt", "r") as showFile:

 for line in showFile:

   cleanString = line.strip()

   seasons = 0

   try:

       seasons = int(cleanString)

       print(type(seasons))

   except:

       pass

   if seasons != 0:

       showName = showFile.readline()

       if seasons in mydict:

           mydict[seasons].append(showName.strip())

       else:

           mydict[seasons] = [showName.strip()]

f = open("output.txt", "a")

finalString = ''

for seasons in mydict:

   finalString += str(seasons) + ": "

   for show in mydict[seasons]:

       finalString += show + '; '

   f.write(finalString[:-2] + '\n')

   finalString = ''

f.close()

Write A Program That First Reads In The Name Of An Input File And Then Reads The Input File Using The

Related Questions

Functions should contain only the code that performs a single task.
O True
O False

Answers

Answer:

false

Explanation:

function should contain more codes

Design traffic lights at an intersection of a city.  North and South (up and down) are going to be a main highway, East and West (right and left) will be a smaller cross street.  There will be no turn signals and no cross walks.  You only need to build/code one set of lights for each street (one set of green, yellow, and red for the highway, and another set for the cross street).  You do not need to build actual traffic lights or an intersection. 

Answers

Answer:

Explanation:

The following code is written in Java. In order to code this efficiently, I created a class for the trafficLights. The class contains the currentLight, and the streetType as variables and contains a constructore, getter and setter methods, and a method to turn to the next light in the sequence. Then I created 4 objects of TrafficLights for the highways and the streets.

class Brainly {

   public static void main(String[] args) {

       TrafficLights highwaySouth = new TrafficLights("Highway", "green");

       TrafficLights highwayNorth = new TrafficLights("Highway", "green");

       TrafficLights streetEast = new TrafficLights("Street", "yellow");

       TrafficLights streetWest = new TrafficLights("Street", "red");

   }

}

class TrafficLights {

   String streetType, currentLight;

   public TrafficLights(String streetType, String currentLight) {

       this.streetType = streetType;

       this.currentLight = currentLight;

   }

   public void nextLight() {

       if (this.currentLight == "green") {

           this.currentLight = "yellow";

       } else if (this.currentLight == "yellow") {

           this.currentLight = "red";

       } else {

           this.currentLight = "green";

       }

   }

   public String getStreetType() {

       return streetType;

   }

   public void setStreetType(String streetType) {

       this.streetType = streetType;

   }

   public String getCurrentLight() {

       return currentLight;

   }

   public void setCurrentLight(String currentLight) {

       this.currentLight = currentLight;

   }

}

What does Falstaff do to protect himself in battle? ​

Answers

bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark bark

x-1; while x ==1 disp(x) end, then the result a. infinity or b. (1) ​

Answers

Answer:

1 is the answer because ur trying to trick us

Explanation:

We will find an video named????
Help us and select once name.
Complete: B__in___t

Answers

Beint cause its cool yea yea
Beinlit (pronounced ben-in-lit)

Think about that the C, B and S parameters of a Cache. Think about what happens to compulsory, capacity, conflict misses, if only each of the following parameter changed (the other two are kept the same)?
(i) C is increased (S, B same)
(ii) S is increased (C, B Same)
(iii) B is increased (C, S Same)

Answers

Answer:

(i) C is increased (S, B same)

Explanation:

Cache are items which are stored in the computer at a hidden place. These are sometimes unwanted and they may hinder the speed and performance of the device. They exist to bridge speed gap.

Heinrich Koch is a second-year college student. Last semester his best friend had his laptop stolen. The laptop was an old computer that he planned to replace soon, but the greatest loss was his data: he had not performed a backup and all his data was lost. Heinrich himself does not perform data backups but knows that he needs to do that on a regular basis. He has decided to use an online backup service that will automatically back up his data whenever it changes. Evaluate and compare reviews of online backup services. Consider iDrive, Carbonite, Acronis True Image, BackBlaze, and others you might find in your research. Recommend a service that you consider the best solution for Heinrich. Discuss your reviews and mention speed, security, and features in your recommendation.

Answers

Answer:

Acronis True Image is the one I would recommend out of these mentioned online backup services.

Explanation:

The evaluations and reviews of each of the online backup services are as follows:

a. iDrive

For this, we have:

Speed = 60% - fair

Security = 100% - excellent

Privacy = 88% - very good

Features = 95% - excellent

Pricing = 85% - Very good

Because of its various features, pricing, and usability, IDrive reviews suggest that it is a very efficient online backup solution. However, there have been complaints concerning its speed and the fact that there are no monthly plans available.

b. Carbonite

For this, we have:

Speed = 60% - fair

Security = 100% - excellent

Privacy = 87% - very good

Pricing = 85% - very good

File backup and restoration = 75% - good

Carbonite reviews reveal that it is simple to use and provides limitless backup for one device. The main drawback is that it has extremely poor backup speeds.

c. Acronis True Image

This is fast, simple and intuitive

It has complete control over the backup updates, including how and when they occur.

It is not expensive.

Acrnonis True image is a powerful backup storage service. It enables data and file backup and restoration from USB drives.

Many reviewers of Acrnonis True image have stated that they have had no issues with its service, that it is worth purchasing, and that there are no concerns.

d. Backblaze

For this, we have:

Speed = 75% - good

Security = 75% - good

Privacy = 70% - decent

Pricing = 100% - excellent

Support = 95% - excellent

Features = 65% - decent

File back-up and restoration = 70% - decent

Backblaze is one of the most popular internet backup services. This storage service, however, does not allow for ustomization.

Recommendation

Acronis True Image is the one I would recommend out of these mentioned online backup services. This is due to the fact that it delivers a large amount of accurate and high-quality data storage. It is quick, simple and intuitive, which is what most people care about. Furthermore, reviewers have stated that this service is quite effective and that there have been very few issues with it. The other services demonstrate that their services have flaws, such as lack of customization and slowness.

The number of host addresses are available on the network 172.16.128.0 with a subnet mask of 255.255.252.0. Show the calculations.​

Answers

Answer:

adress: 10101100.00010000.1 0000000.00000000

netmask: 11111111.11111111.1 0000000.00000000

Network:   172.16.128.0/17       10101100.00010000.1 0000000.00000000 (Class B)

Explanation:

ex: 10 -> 00001010

200 ->11001000

Given the following tree, use the hill climbing procedure to climb up the tree. Use your suggested solutions to problems if encountered. K is the goal state and numbers written on each node is the estimate of remaining distance to the goal.

Answers

I see that using the hill climbing procedure to climb up a tree

Given that EAX contains FFFF80C0h, which of the following would be true after executing the CWD instruction?

a. AX=FFFFh, DX=80C0h
b. EDX=FFFFFFFFh, EAX=FFFF80C0h
c. DX=FFFFh, AX=80C0h
d. cannot be determined

Answers

Answer:

c. DX=FFFFh, AX=80C0h

Explanation:

CWD instruction set all bits in DX register with same sign as in AX register. The effect is to create a 32 bit sign result. This will have same integer value as of 16 bit.



Every Java statement ends with: *

Period
Colon
Double quote
Semicolon

Answers

Answer:

semicolon is the answer

semi colon i did that test

Questions to ask people on how corona has affected the religion sectors​

Answers

Answer:

bcoz of corona all churches and temples are closed and pilgrimage are cancelled

An infographic displays the relative frequencies of the 100 most common emojis used in text messaging for each of the last 12 months. Which of the following conclusions cannot be drawn from such a representation of emoji usage?
a. You can determine the growth or decline in popularity of a particular emoji.
b. You can determine what percentage of text messages contains a particular emoji.
c. You can determine how long the most popular emoji has held the #1 position.
d. You can determine the average age of emoji users based on emoji use.

Answers

Answer:

d. you can determine the average age of emoji users based on emoji use.

Explanation:

The infographic displays 100 most common emoji used in text messaging. This information can be used to determine percentages of text message which contains particular emoji. This details can not determine the age of emoji user based in emoji use.

What do application in productivity suites have in common

Answers

Answer:

The function of the suites application is to create presentations and perform numerical calculations.

Explanation:

Given two regular expressions r1 and r2, construct a decision procedure to determine whether the language of r1 is contained in the language r2; that is, the language of r1 is a subset of the language of r2.

Answers

Answer:

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Explanation:

An algorithm must be guaranteed to halt after a finite number of steps.

Each step of the algorithm must be well specified (deterministic rather than non-deterministic).

Three basic problems:

Given an FA M and an input x, does M accept x?

Is x in L(M)

Given an FA M, is there a string that it accepts?

Is L(M) the empty set?

Given an FA M, is L(M) finite?

Algorithm for determining if M accepts x.

Simply execute M on x.

Output yes if we end up at an accepting state.

This algorithm clearly halts after a finite number of steps, and it is well specified.

This algorithm is also clearly correct.

Testing if L(M) is empty.

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if all strings are rejected.

The "algorithm" is well specified, and it is also clearly correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we use the algorithm for the first problem as a subroutine; you must think in this fashion to solve the problems we will ask.

Correct Algorithm

Simulate M on all strings of length between 0 and n-1 where M has n states.

Output no if and only if all strings are rejected.

Otherwise output yes.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts any strings, it must accept one of length at most n-1.

Suppose this is not true; that is, L(M) is not empty but the shortest string accepted by M has a length of at least n.

Let x be the shortest string accepted by M where |x| > n-1.

Using the Pumping Lemma, we know that there must be a "loop" in x which can be pumped 0 times to create a shorter string in L.

This is a contradiction and the result follows.

COMMENT: There are more efficient algorithms, but we won't get into that.

Testing if L(M) is finite

Incorrect "Algorithm"

Simulate M on all strings x.

Output yes if and only if there are a finite number of yes answers.

This "algorithm" is well specified and correct.

However, this is not an algorithm because there are an infinite number of strings to simulate M on, and thus it is not guaranteed to halt in a finite amount of time.

COMMENT: Note we again use the algorithm for the first problem as a subroutine.

Correct Algorithm

Simulate M on all strings of length between n and 2n-1 where M has n states.

Output yes if and only if no string is accepted.

Otherwise output no.

This algorithm clearly halts after a finite number of steps, and it is well specified.

The correctness of the algorithm follows from the fact that if M accepts an infinite number of strings, it must accept one of length between n and 2n-1.

This builds on the idea that if M accepts an infinite number of strings, there must be a "loop" that can be pumped.

This loop must have length at most n.

When we pump it 0 times, we have a string of length less than n.

When we pump it once, we increase the length of the string by at most n so we cannot exceed 2n-1. The problem is we might not exceed n-1 yet.

The key is we can keep pumping it and at some point, its length must exceed n-1, and in the step it does, it cannot jump past 2n-1 since the size of the loop is at most n.

 This proof is not totally correct, but it captures the key idea.

COMMENT: There again are more efficient algorithms, but we won't get into that.

   Other problems we can solve using these basic algorithms (and other algorithms we've seen earlier this chapter) as subroutines.

       COMMENT: many of these algorithms depend on your understanding of basic set operations such as set complement, set difference, set union, etc.

Given a regular expression r, is Lr finite?

Convert r to an equivalent FA M.

COMMENT: note we use the two algorithms for converting a regular expression to an NFA and then an NFA to an FA.

Test if L(M) is finite.

Output the answer to the above test.

Given two FAs M1 and M2, is L(M1) = L(M2)?

Construct FA M1-2 from M1 and M2 which recognizes the language L(>M1) - L(>M2).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M1-2) is empty.

Construct FA M2-1 from M1 and M2 which recognizes the language L(>M2) - L(>M1).

COMMENT: note we use the algorithm that is instrumental in proving that regular languages are closed with respect to the set difference operator.

Test if L(M2-1) is empty.

Answer yes if and only if both answers were yes.

Create a file named A10.java. Place all your code in this file. Create a publicstatic ArrayList of integers named intList.
Define a public static method addNumber(int i) that adds ito your list.
Exercise 2
Create a publicstatic HashMap of integers,integers namedintMap.
Define a public static method addPair(int i,int j) that adds i,jto your HashMap (make ithe key and j the value).

Answers

Explanation:

The file named as A10.java has been attached to this response. It contains the source code for the exercises. The source code contains comments explaining important parts of the code.

A few things to note;

i. To add an item to an arraylist, the add() method is used. For example to add an integer 7 to the arraylist named intList, simply write;

intList.add(7);

ii. To add an item to a hashmap, the put() method is used. The put method receives two parameters which are the key and value respectively. The key is a form of identifier used to store or retrieve a particular value in a hashmap. To store an integer 8 with a key of 5 in a hashmap named intMap, for example, simply write;

intMap.put(5,8);

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity? Select all that apply. There must be a maximum of one attribute instance. There must be many instances of the attribute There must be at most one entity instance that each attribute instance describes. There must be at least one instance of the attribute. There must be zero or more instances of the attribute. Question 2 (2 points) True or false: A singular attribute is also known as a unique attribute. True False Question 3 (3 points) Saved Relationship names and types of relationship maxima or minima that each could have are listed below. Match each relationship in the list below to the type of relationship maxima or minima. Instructions: Choose your responses from the drop-down menus below. Response options cannot be used more than once. Minima is One-Zero 1 Person-Assigned Social SecurityNumber 4 Minima is Zero Zero 2 CubicleNumber-Assigned-to- Employee per shift 2 Maxima is One-Many 3. Birthdate-Recorded-for-a Person 1 Maxima is One One 4. Women-Bearing-Children Question 4 (2 points) Saved A ride-sharing app's discount system for riders is configured such that a ride discount is triggered only if at least two RiderlDs book a ride in the same Card at the same time. Which of the following is true of the relationship Ride Discount-is-Applicable?
The relationship minimum is Many-One.
The relationship minimum is Two-One.
The relationship maximum is One-Two.
The relationship minimum is One-Two.

Answers

Answer:

Saved In order to be used as a primary key, which of these characteristics must an attribute possess with respect to a single instance of the entity:

There must be a maximum of one attribute instance.

There must be many instances of the attribute.

There must be at most one entity instance that each attribute instance describes.

There must be at least one instance of the attribute.

A singular attribute is also known as a unique attribute. True

Saved Relationship names and types of relationship maxima or minima that each could have are listed below. True

Explanation:

multimedia is an effective tool used in different fields such as business and education true or false​

Answers

Answer:

True

Explanation:

Multimedia is used in many fields. It is basically the ability to express something in many different ways. This allows you to more easily demonstrate a product, idea, or even a theory. Since this can be through art, video, presentation, text, live, etc. It allows you to find the best format for the specific product or idea that you are trying to present to a group of viewers. That is why it is an effective tool for various fields since it can just as easily help a company sell a product as well as help a teacher express a mathematical concept.

Explain in details:
(i) Deadlock
(ii) File manager
(iii) Process
(iv) Multiprogramming
(v) Software Classification
(vi) Virtual memory

Answers

Answer and Explanation:

Deadlock occurs when two operating systems on the same computer are hindering each other's execution, getting blocked, waiting for each one to run first. This can happen when a preemption has not occurred, when a mutual exclusion has occurred, or when one of the systems causes the other to not execute.

File manager is software that allows a computer user to create directories and organize files inside and outside of them.

Process is the term used to determine the functioning of computer software. When a software is started, it uses its own programming code to perform a specific activity.

Multiprogramming is the term used for the moment when an operating system allows the user to run more than one software at the same time. For this to happen, the computer needs to have a high processing capacity, to handle the effort of running several software simultaneously.

Software Classification is the process that determines the composition and different aspects that make up a software. In this way, it is possible to understand the usefulness and programming of this software.

Virtual memory is the use of secondary memory for caching. This allows the user to share files more securely and quickly, in addition to alleviating the problems that limited memory presents.

Viết chương trình kiểm tra số nguyên dương N có phải là số nguyên tố không?

Answers

Could you say that in English please? I can try helping

Why might you use a navigation form instead of tab pages? The navigation form allows for several levels and sublevels to be collected. The navigation form allows for duplicate records of information to be collected. The navigation form requires all entries to be complete before adding to a database. The navigation form requires report headers and footers to make publication neater.

Answers

Answer:

Access includes a Navigation Control that makes it easy to switch between various forms and reports in your database. A navigation form is simply a form that contains a Navigation Control. Navigation forms are a great addition to any desktop database.

Explanation:

yes

Answer:

answer c

Explanation:

correct answer on edge

bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào

Answers

answer:

yes....................

What type of editor is used to edit HTML code?What type of editor is used to edit HTML code?

Answers

For learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac).

mark me brainliestt :))

Answer:

If you want to use HTML editor in windows, you can use notepad. And if you want to use HTML editor on your phone than you need to install any editor on your phone.

Explanation:

If you want to use another app than notepad in pc, laptop, mac, OS or Linux, you can download a editor known as Visual Studio Code. If you want to do another language you can also do it in it. You can do all programming languages in it.

Design a function int maxDigit (int num) to find and return the greatest digit from the arguments value num.
Also write a function void result() by passing parameters to print the greatest digit.
please tell in java programming​

Answers

Answer:

Below is the required JAVA Code:

Explanation:

public static int largestDigit(int n) {

   if (n < 0) {

       return largestDigit(-1 * n);

   } else if (n == 0) {

       return 0;

   } else {

       int digit = n % 10;

       int maxDigit = largestDigit(n / 10);

       if (digit > maxDigit)

           maxDigit = digit;

       return maxDigit;

   }

}

\color{red}Method\;tested\;in\;a\;complete\;java\;program\;if\;you\;are\;interested.

public class LargestDigitRecursive {

   public static int largestDigit(int n) {

       if (n < 0) {

           return largestDigit(-1 * n);

       } else if (n == 0) {

           return 0;

       } else {

           int digit = n % 10;

           int maxDigit = largestDigit(n / 10);

           if (digit > maxDigit)

               maxDigit = digit;

           return maxDigit;

       }

   }

   public static void main(String[] args) {

       System.out.println(largestDigit(14263203));

       System.out.println(largestDigit(845));

       System.out.println(largestDigit(52649));

       System.out.println(largestDigit(3));

       System.out.println(largestDigit(0));

       System.out.println(largestDigit(-573026));

       System.out.println(largestDigit(-2));

   }

}

OUTPUT:

6

8

9

3

0

7

2

A python code only runs the except block when _____. Group of answer choices all the statements in the try block are executed an error occurs in the preceding try block the programmer manually calls the except block an error occurs anywhere in the code

Answers

Answer:

Python only running exception block when try block fails

Explanation:

i do cyber security and i was learning this in high school

In Python, try and except statements are used to catch and manage exceptions. Statements that can generate exceptions were placed within the try clause, while statements that handle the exception are put within the except clause.

An exception should be caught by except block, which is used to test code for errors that are specified in the "try" block. The content of the "except" block is executed if such a fault/error appears.In Python, the exception block only runs when an error occurs in the try block.

Therefore, the answer is "try block fails ".

Learn more:

brainly.com/question/19154398

For minimization problems, the optimal objective function value to the LP relaxation provides what for the optimal objective function value of the ILP problem?

Answers

Answer:

A lower bound on the optimal integer value.

Explanation:

The question is poorly typed.  The original question requires the optimal solution of the objective function of a minimization problem

I will answer this question base on the above illustration.

When an objective function is to be minimized, it means that the objective function will take the feasible solution with the least value.

The least value are often referred to as the lower bound.

what is the Is option that prints the author of a file​

Answers

Answer:

Print.. is your answer...

After reading all L02 content pages in Lesson 02: Inheritance and Interfaces, you will complete this assignment according to the information below.Do not use the scanner class or any other user input request. You application should be self-contained and run without user input.Assignment ObjectivesPractice on implementing interfaces in JavaFootballPlayer will implement the interface TableMemberOverriding methodswhen FootballPlayer implements TableMember, FootballPlayer will have to write the real Java code for all the interface abstract methodsDeliverablesA zipped Java project according to the How to submit Labs and Assignments guide.O.O. Requirements (these items will be part of your grade)One class, one file. Don't create multiple classes in the same .java fileDon't use static variables and methodsEncapsulation: make sure you protect your class variables and provide access to them through get and set methodsAll the classes are required to have a constructor that receives all the attributes as parameters and update the attributes accordinglyAll the classes are required to have an "empty" constructor that receives no parameters but updates all the attributes as neededFollow Horstmann's Java Language Coding GuidelinesOrganized in packages (MVC - Model - View Controller)Contents

Answers

Solution :

App.java:  

import Controller.Controller;

import Model.Model;

import View.View;  

public class App

{  

public static void main(String[] args) // Main method

{  

Model model = new Model(); // Creates model object.    

View view = new View(); // Creates view object.    

Controller controller = new Controller(view, model); // Creates controller object that accepts view and model objects.    

}

}  

[tex]\text{Controller.java:}[/tex]  

package Controller;  

[tex]\text{impor}t \text{ Model.Model;}[/tex]

import View.View;  

[tex]\text{public class Controller}[/tex]

{

Model model; // Model object    

View view; // View object

public Controller(View v, Model m) // Method that imports both model and view classes as objects.

{

model = m;    

view = v;  

//view.basicDisplay(model.getData()); // basicDisplay method from View class prints FootballPlayer objects as Strings from Model class.  

view.basicDisplay(model.getMembers().get(1).getAttributeName(3));    

view.basicDisplay(model.getMembers().get(1).getAttribute(3));    

view.basicDisplay(model.getMembers().get(1).getAttributeNames());    

view.basicDisplay(model.getMembers().get(1).getAttributes());    

view.basicDisplay("size of names=" + model.getMembers().get(1).getAttributeNames().size());    

view.basicDisplay("size of attributes=" + model.getMembers().get(1).getAttributes().size());

}  

}  

FootballPlayer.java:

package Model;  

import java.util.ArrayList;  

public class FootballPlayer extends Person implements TableMember { // Used "extends" keyword to inherit attributes from superclass Person, while using "implements" to implement methods from TableMember interface.    

private int number; // Creating private attribute for int number.    

private String position; // Creating private attribute for String position.  

public FootballPlayer(String name, int feet, int inches, int weight, String hometown, String highSchool, int number, String position) // Full parameter constructor for FootballPlayer object (using "super" keyword to incorporate attributes from superclass).

{

super(name, feet, inches, weight, hometown, highSchool); // Used super keyword to include attributes from superclass.  

this.number = number; // Value assigned from getNumber method to private number instance variable for FootballPlayer object.  

this.position = position; // Value assigned from getPosition method to private position instance variable for FootballPlayer object.    

}  

public FootballPlayer() // No parameter constructor for FootballPlayer object.

{

this.number = 0; // Default value assigned to private number instance variable under no parameter constructor for FootballPlayer object.    

this.position = "N/A"; // Default value assigned to private position instance variable under no parameter constructor for FootballPlayer object.    

}  

Override

public String getAttribute(int n) // getAttribute method that is implemented from interface.

{

switch (n) { // Switch statement for each attribute from each FootballPlayer object. Including two local attributes, denoted by this. While the others are denoted by "super".

case 0:

return String.valueOf(this.number); // Use of the dot operator allowed me to discover String.valueOf method to output int attributes as a string.

case 1:

return this.position;

case 2:

return super.getName();

case 3:

return super.getHeight().toString();

case 4:

return String.valueOf(super.getWeight());

case 5:

return super.getHometown();

case 6:

return super.getHighSchool();

default:

return ("invalid input parameter");

}

}  

Override

public ArrayList<String> getAttributes() // getAttributes ArrayList method that is implemented from interface.

{

ArrayList<String> getAttributes = new ArrayList<>();    

for(int i = 0; i <= 6; i++){ // For loop to add each attribute to the getAttributes ArrayList from getAttributes method.    

getAttributes.add(getAttribute(i));    

}    

return getAttributes;

}  

Override

public String getAttributeName(int n) // getAttributeName method implemented from interface.

{

switch (n) { // Switch statement for the name of each attribute from each FootballPlayer object.

case 0:

return "number";

case 1:

return "position";

case 2:

return "name";

case 3:

return "height";

case 4:

return "weight";

case 5:

return "hometown";

case 6:

return "highSchool";

default:

return ("invalid input parameter");

}  

}  

what is the meaning of photography​

Answers

Answer and Explanation:

the process or art of producing images of objects on sensitized surfaces by the chemical action of light or of other forms of radiant energy, as x-rays, gamma rays, or cosmic rays.

[tex] \sf\underline{ Photography} \:  is \: the \: way \: / \: process \: / \: art \\ \sf \: of \: taking \: beautiful \: pictures \\ \sf \: usually \: of \: amazing \: sceneries \: (it \: can \: be \: of \: other \: \\ \sf things \: as \: well) \: for \: visual \: pleasure. \: The \: attached \: picture \\ \sf \: is \: an \: example \: for \: a \: good \\ \sf\: type \: of \: photography. \: A \: person \: who \: practices \: the \: \\\sf art \: of \: photography \: is \: known \: as \: a \: \underline{ photographer}.[/tex]

Which of the following CALL instructions writes the contents of EAX to standard output as a signed decimal integer?
a. call WriteInteger
b. call WriteDec
c. call WriteHex
d. call WriteInt

Answers

Answer:

d. call WriteInt

Explanation:

Required

Instruction to write to decimal integer

Of the 4 instructions, the call WriteInt instruction is used write to a decimal integer.

This is so, because the WriteInt instruction writes a signed decimal integer to standard output.

This implies that the output will have a sign (positive or negative) and the output will start from a digit other than 0 (i.e. no leading zero)

Other Questions
How many exterior walls does the building have? explain the attitudes and politics toward immigration in the 1920s 2) If the question asked why the boy went to thepark, and your answer is 2:00 p.m., does youranswer make sense? PLEASE help!! ill give brainliestwhat is the rhyme sceme of the third stanza of william wordsworths poem? Question 3 of 5Which term refers to a transfer of thermal energy between objects?O A. TemperatureOB. HeatO C. Kinetic energyO D. Potential energy Which direct object pronoun correctly completes the sentence?Mayabel lee un libro.Mayabel ______ lee.meellalo In this passage by the Roman poet Virgil, Queen Dido speaks about the responsibilities of a ruler. How does the phrase infant state in the second line affect the tone? California wildfires destroy vineyards across the Napa Valley. This is during the season when wine festivals occur most often all over the country. Demonstrate the effect of these events on the equilibrium price and quantity of wine. An infographic displays the relative frequencies of the 100 most common emojis used in text messaging for each of the last 12 months. Which of the following conclusions cannot be drawn from such a representation of emoji usage?a. You can determine the growth or decline in popularity of a particular emoji.b. You can determine what percentage of text messages contains a particular emoji.c. You can determine how long the most popular emoji has held the #1 position.d. You can determine the average age of emoji users based on emoji use. tolong saya jawab yahhh correct the pronouns in the following sentences An internet buyer Our galaxy, the ______________, contains more than 200 billion stars. A 3 by 3cm grid shows nine 1 by 1 cm squares and uses 24cm of wire.What length would the wire be for a similar 20 by 20cm sqaure Two particles, with identical positive charges and a separation of 2.65 10-2 m, are released from rest. Immediately after the release, particle 1 has an acceleration 1 whose magnitude is 5.00 103 m/s2, while particle 2 has an acceleration 2 whose magnitude is 7.70 103 m/s2. Particle 1 has a mass of 6.20 10-6 kg. (a) Find the charge on each particle. q1 = C q2 = C (b) Find the mass of particle 2. kg Can someone help me with this. Will mark brainliest. Thank you. World War 1 took place from ______________ to _____________, and was known during that time as the ___________________________ . did you mom ever yell at you How did Ethiopia respond to Italian attempts to colonize its territory in the19th century?A. It formed a close alliance with Italy that allowed African leaders toremain in power.B. It launched a successful military campaign to force Italy to give upits claim.C. It invited other European imperial powers to share control of itsterritory with ItalyO D. It organized an emigration campaign that led most of itspopulation to leave the country.SUBMIT- PREVIOUS Can somebody help Ill give brainless plss (FIRST CORRECT FOR BRAINIEST) Solve for x