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
dmitriy555 [2]
3 years ago
9

CHALLENGE 7.1.1: Initialize a list. ACTIVITY Initialize the list short.names with strings 'Gus', Bob, and 'Ann'. Sample output f

or the given program Gus Bob Ann 1 short_names- Your solution goes here 2 # print names 4 print(short_names[0]) 5 print(short names [11) 6 print(short_names[2])
Computers and Technology
1 answer:
vlabodo [156]3 years ago
3 0

Answer:

short_names = ["Gus", "Bob", "Ann"]

print(short_names[0])

print(short_names[1])

print(short_names[2])

Explanation:

There are some typos in your code. In addition to the missing part of the code, I corrected the typos.

First of all, initialize the list called short_names. The list starts with "[" and ends with "]". Between those, there are must be the names (Since each name is a string, they must be written between "" and there must be a semicolon between each name)

Then, you can print each name by writing the name of the list and the index of the names between brackets (Index implies the position of the element and it starts with 0)

You might be interested in
[ASAP!] Which of these can be a problem for people with accessibility issues? Select 4 options.
Elena-2011 [213]

Answer:

<u><em>Flashing images</em></u>

Explanation:

Content that flashes or flickers can trigger seizures in susceptible individuals. Therefore flashing or <u>flickering content should be avoided</u>.

7 0
2 years ago
The following program uses a variable workHoursPerWeek rather than directly using 40 in the salary calculation expression.
Serjik [45]

Answer:

<u> Initial program output (from original program)</u>

Annual salary is: 40000

Monthly salary is: 3333

<u>Program output after workHoursPerWeek = 35</u>

Annual salary is: 35000

Monthly salary is: 2916

<u>Revised program (using variable workWeeksPerYear)</u>

  1.    public static void main(String[] args) {
  2.        int hourlyWage = 20;
  3.        int workHoursPerWeek = 35;
  4.        int workWeeksPerYear = 52;
  5.        int annualSalary = 0;
  6.        annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  7.        System.out.print("Annual salary is: ");
  8.        System.out.println(annualSalary);
  9.        System.out.print("Monthly salary is: ");
  10.        System.out.println((hourlyWage * workHoursPerWeek * workWeeksPerYear) / 12);
  11.        return;
  12.    }

Program output:

Annual salary is: 36400

Monthly salary is: 3033

<u>Revised Program after introducing monthly salary</u>

  1.    public static void main(String[] args) {
  2.        int hourlyWage = 20;
  3.        int workHoursPerWeek = 35;
  4.        int workWeeksPerYear = 52;
  5.        int annualSalary = 0;
  6.        int monthlySalary = 0;
  7.        
  8.        annualSalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  9.        monthlySalary = hourlyWage * workHoursPerWeek * workWeeksPerYear;
  10.        
  11.        System.out.print("Annual salary is: ");
  12.        System.out.println(annualSalary);
  13.        System.out.print("Monthly salary is: ");
  14.        System.out.println((monthlySalary) / 12);
  15.        return;
  16.    }

Explanation:

One reason to use variable to replace the magic number is to improve the readability of the program. If we compared the revised version of the program with the original program, we will find that the variable enable our code easier to understand.

Besides, if we wish to change the value (e.g. working hours per year or per month), we just need to adjust the value assigned on the variables. The variables provide a single access point to get or change the value.

7 0
3 years ago
You have enabled IP routing on PLABSA01 after enabling the IPRouter in the registry. How will you verify whether the IP routing
drek231 [11]

Answer:

By typing ipconfig at the command prompt

Explanation:

To check if an ip router is enabled in a registry, simply do the following:

1. launch your command prompt from accessories in your windows start button

2. Type this command IPconfig

3. Strike the enter button on the keyboard

It will display the various pack of upload and download indicating how packages are routed.

4 0
3 years ago
The memory management layer is the part of the kernel that serves out all memory allocation requests.
svetlana [45]
Most likely it’s False . But look it up just in case
4 0
3 years ago
If you add 111 and 0101 in 4-bit signed fields, is there a carry or overflow?
Ghella [55]

Answer: there is an overflow

Explanation:

Here using 4-bit signed fields to store the addition value.

0111 + 0101 = 1100

In above addition the MSB is reserved for sign.

If MSB is 0 means the number is positive.

If MSB is 1 means the number is negative.

The first number 0111 has MSB 0 means it is a positive number.

The second number 0101 has MSB 0 means it is also a positive number.

But after addition the result obtained is 1100 which MSB is 1 indicating the

result is negative number.

How can it be possible to add two positive numbers and get a negative number as result.

This type of situation is called overflow situation.

It is used for error detection purpose.

therefore there is an overflow

4 0
3 years ago
Other questions:
  • An enterprise DBMS is automatically capable of serving as a mobile DBMS. There are no special issues raised by mobility. True Fa
    11·1 answer
  • When a packet with the code is transmitted, it is received and processed by every machine on the network. this mode of operation
    12·1 answer
  • Which VPN topology is also known as a hub-and-spoke configuration?
    15·1 answer
  • Why is printer an output device​
    14·2 answers
  • How to share pictures on brainy ​
    8·1 answer
  • Tricia is managing tasks that have been assigned to her. She needs to enter mileage information in relation to a project. Which
    5·1 answer
  • A major retailer wants to enhance their customer experience and reduce losses
    9·1 answer
  • 10. Site-to-Site VPN architecture is also known as
    6·1 answer
  • Which of the following best describes the impact of Creative Commons?
    7·1 answer
  • If we increase the sample rate of a device from 48khz to 96khz, what is the impact to the network?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!