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

1| def saveUserProfile(firstName, lastName, age, height, country):

Computers and Technology
1 answer:
Feliz [49]2 years ago
7 0

Answer:

Joyner

David

USA

1.8

30

Explanation:

def saveUserProfile(firstName, lastName, age, height, country):

This is the definition of function named saveUserProfile which accepts the following parameters:

  • firstName
  • lastName
  • age
  • height
  • country

filename = lastName + firstName + ".txt"

When the file is created it will be named as the lastName and firstName string combined with .txt as extension. For example if the lastName contains the name string Joyner and firstName contains the name David then the file created to be written is named as JoynerDavid.txt

outputFile = open(filename, "w")

This statement uses open() method in write mode and uses outputFile object to access the file. "w" represents write mode i.e. file is opened in write mode to write on it.

a) Joyner is written on line 1 of that file because of the following statement of above function:

print(lastName, file = outputFile)

This statement prints the string stored in lastName i.e. Joyner. Here outputFile opens the file in "w" write mode and writes the last name to the first line of the file.

b) David is written on line 2 of that file because of the following statement of above function:

print(firstName, file = outputFile)

This statement prints the string stored in firstName i.e. David. Here outputFile opens the file in "w" write mode and writes the first name to the second line of the file.

c) USA is written on line 3 of that file because of the following statement of above function:

print(country, file = outputFile)

This statement prints the data stored in country i.e. USA. Here outputFile opens the file in "w" write mode and writes the country name to the third line of the file.  

d) 1.8 is written on line 4 of that file because of the following statement of above function:

print(height, file = outputFile)

This statement prints the value stored in height i.e. 1.8. Here outputFile opens the file in "w" write mode and writes the height value to the fourth line of the file.  

e) 30 is written on line 5 of that file because of the following statement of above function:

print(age, file = outputFile)

This statement prints the value stored in age parameter of function saveUserProfile i.e. 30. Here outputFile opens the file in "w" write mode and writes the age value to the fifth line of the file.  

You might be interested in
Explain briefly how learning how to follow can make a person a good leader
Masja [62]

By  learning how to follow, one can  be a good leader because: Looking up to a leader and following them help to:

  • Keep one's ego in check and one can be able to be a good ego manager.
  • They create strong credibility.
  • They help use to focus our efforts for maximum impact.

<h3>How does being a good follower make you a good leader?</h3>

As a good follower, a person can be able to have the boldness and confidence to be able to respectfully talk about a lot of things with their leader if you see that you're not going in the right way.

Note that  one can trust your leader and this will boast up the spirit of your input and engagement in all.

Hence, By  learning how to follow, one can  be a good leader because: Looking up to a leader and following them help to:

  • Keep one's ego in check and one can be able to be a good ego manager.
  • They create strong credibility.
  • They help use to focus our efforts for maximum impact.

Learn more about good leader from

brainly.com/question/12522775

#SPJ1

3 0
1 year ago
Which of these allows the programmer to put data inside a variable?
gregori [183]

Answer:

it's the equal sign "="

5 0
2 years ago
2. Because technology is always changing, there are new applications being developed constantly. (1 point)
Zepler [3.9K]
True because we need new tech
4 0
3 years ago
Read 2 more answers
8.18 **zyLab: Schedule Generator Write this program using an IDE. Comment and style the code according to the CS 200 Style Guide
Lera25 [3.4K]

Answer:

huh

Explanation:

sfdghjklhgfdsghjkhgfdsfghjk

3 0
2 years ago
If myClass has a constructor with a parameter of type String, select the other constructor that should be included.
JulijaS [17]

Answer:

d. public myClass( ) {. . .}

Explanation:

A constructor is a special method that is called when an object of a class is created. It is also used to initialize the instance variables of the given class. A class may have one or more constructors provided that these constructors have different signatures. A class that does not have a constructor explicitly defined has a default parameterless constructor.

Having said these about a constructor, a few other things are worth to be noted by a constructor.

i. In Java, a constructor has the same name as the name of its class.

For example, in the given class <em>myClass</em>, the constructor(s) should also have the name <em>myClass</em>.

ii. A constructor does not have a return value. It is therefore wrong to write a constructor like this:

<em>public void myClass(){...}</em>

This makes option a incorrect.

iii. When a constructor with parameters is defined, the default parameterless constructor is overridden. This might break the code if some other parts  of the program depend on this constructor. So it is advisable to always explicitly write the default parameterless constructor.

This makes option d a correct option.

Other options b and c may also be correct but there is no additional information in the question to help establish or justify that.

7 0
3 years ago
Other questions:
  • Prewritten, commercially available sets of software programs that eliminate the need for a firm to write its own software progra
    5·1 answer
  • How do optical storage devices operate?
    12·1 answer
  • Which of the following is an Internet supervisory protocol? O DNS IP O both A and B O neither A nor B
    12·1 answer
  • The convergence of information technology and operations technology, offering the potential for tremendous improvements in effic
    14·1 answer
  • Precautionary measures to be observed when using ICT tools​
    15·1 answer
  • write a script that creates and calls a stored procedure named insert_category. first, code a statement that creates a procedure
    10·1 answer
  • True or False, In adversarial searching, agents using the MiniMax algorithm always select the state that has the highest guarant
    15·1 answer
  • What is a computer please tell me ​
    10·2 answers
  • At a family reunion, your cousin takes a picture of both of you with her phone, orders a print of it, and mails it to you with a
    5·1 answer
  • Some hackers are skillful computer operators, but others are younger inexperienced people who experienced hackers refer to as?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!