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
As the European powers grew more industrialized, their colonies became very important as sources of A)slave labor. B)raw materia
nadezda [96]
B) Raw materials; As stated, European powers did indeed grow more industrialized, therefore they needed more raw materials. The North provided lumber, spent time whaling, etc.. The South spent time growing cash crops such as rice, cotton, and indigo. 
8 0
3 years ago
Read 2 more answers
Write the class "Tests". Ensure that it stores a student’s first name, last name, all five test scores, the average of those 5 t
zhannawk [14.2K]

Answer:

The following assumption will be made for this assignment;

  • If average score is greater than 75, the letter grade is A
  • If average score is between 66 and 75, the letter grade is B
  • If average score is between 56 and 65, the letter grade is C
  • If average score is between 46 and 55, the letter grade is D
  • If average score is between 40 and 45, the letter grade is E
  • If average score is lesser than 40, the letter grade is F

The program is written in Java and it uses comments to explain difficult lines. The program is as follows

import java.util.*;

public class Tests

{

public static void main(String [] args)

{

 //Declare variables

 Scanner input = new Scanner(System.in);

 String firstname, lastname;

 //Prompt user for name

 System.out.print("Enter Lastname: ");

 lastname = input.next();

 System.out.print("Enter Firstname: ");

 firstname = input.next();

 char grade;

 //Declare Array

 int[] Scores = new int[5];

 //Initialize total scores to 0

 int total = 0;  

  //Decalare Average

  double   average;

 //Prompt user for scores

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

 {

  System.out.print("Enter Score "+(i+1)+": ");

  Scores[i] = input.nextInt();

  //Calculate Total Scores

  total+=Scores[i];

 }

 //Calculate Average

 average = total/5.0;

 //Get Letter Grade

 if(average>75)

 {

 grade = 'A';

 }

 else if(average>65)

 {

 grade = 'B';

 }

 else if(average>55)

 {

 grade = 'C';

 }

 else if(average>45)

 {

 grade = 'D';

 }

 else if(average>40)

 {

 grade = 'E';

 }

 else

 {

 grade = 'F';

 }

 //Print Student Results

 System.out.print("Fullname: "+lastname+", "+firstname);

 System.out.print('\n');

 System.out.print("Total Scores: "+total);

 System.out.print('\n');

 System.out.print("Average Scores: "+average);

 System.out.print('\n');

 System.out.print("Grade: "+grade);

}

}

See Attachment for .java file

Download java
7 0
4 years ago
What is the difference between soft copy output devices and hard copy output devices​
Alecsey [184]

the output printed on the paper is called hardcopy output. some examples are printer and plotter.

the output produced on display screen and audio sound is called soft copy output. some examples are moniter and speaker.

3 0
3 years ago
One of the First-Generation Computer built in 1942 during the Second World War and fully utilized to compute Military Artillery
Temka [501]
ENIAC, in full Electronic Numerical Integrator and Computer, the first programmable general-purpose electronic digital computer, built during World War II by the United States. American physicist John Mauchly, American engineer J. Presper Eckert, Jr., and their colleagues at the Moore School of Electrical Engineering at the University of Pennsylvania led a government-funded project to build an all-electronic computer.

From Brittanica.com
7 0
3 years ago
The Soviet Union's satellite nations were united under (the) _____.
Softa [21]
The Warsaw Pact.
--------------------------
8 0
3 years ago
Read 2 more answers
Other questions:
  • What bus carries a status signal back to the CPU?
    14·1 answer
  • A manufacturer of machine tools creates a spreadsheet of tools and the cost for those. The spreadsheet has four fields: name of
    13·1 answer
  • A user can easily move to the end of a document by pressing the _____ key combination.
    10·2 answers
  • Distinguish between engineering and architecture​
    5·1 answer
  • Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti
    11·1 answer
  • Each type of text has a purpose for the reader if you were looking to research penguins what type of text would u utilize
    11·1 answer
  • Maria is an experienced programmer who has worked on different projects. she was recently promoted to be a software development
    11·2 answers
  • What was the purpose of the Internet Architecture Board?
    12·2 answers
  • SOMEONE PLEASE HELP ME WITH THIS ILL GIVE YOU BRAINLY IF YOU GET IT RIGHT PLEASE!!!!!
    13·2 answers
  • Input a list of employee names and salaries and store them in parallel arrays. End the input with a sentinel value. The salaries
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!