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
Marta_Voda [28]
3 years ago
5

Lyrics = ["I wanna be your endgame", "I wanna be your first string",

Computers and Technology
1 answer:
ASHA 777 [7]3 years ago
8 0

Answer:

I am writing the Python program:

lyrics = ["I wanna be your endgame", "I wanna be your first string",

     "I wanna be your A-Team", "I wanna be your endgame, endgame"]

lines_of_sanity = 6

counter = 0

while counter <= lines_of_sanity+1:

 for line in lyrics:

   print(line)

   counter = counter + 1

print("MAKE IT STOP")

                                                                                                       

Explanation:

  • The lyrics is a list which has the following lines of song.

I wanna be your endgame

I wanna be your first string

I wanna be your A-Team

I wanna be your endgame, endgame

  • The value of lines_of_sanity is 6.
  • counter variable is initialized to 0.
  • The while loop starts which keeps executing until the value of counter becomes greater than 6 which is the value of lines_of_sanity
  • The for loop inside the while loop moves through each line of lyrics list and prints that line. The counter variable increments to 1 at each iteration.
  • Lets see what the while and for loops print at each iteration:

1st iteration: counter = 0, following line is displayed:

  • I wanna be your endgame
  • Value of counter increments by 1.
  • counter = 1

2nd iteration: counter = 1, following line is displayed:

  • I wanna be your first string
  • Value of counter increments by 1.
  • counter = 2

3rd iteration: counter = 2, following line is displayed:

  • I wanna be your A-Team
  • Value of counter increments by 1.
  • counter = 3

4th iteration: counter = 3, following line is displayed:

  • I wanna be your endgame, endgame
  • Value of counter increments by 1.
  • counter = 4

5th iteration: counter = 4, following line is displayed:

  • I wanna be your endgame
  • Value of counter increments by 1.
  • counter = 5

6th iteration: counter = 5, following line is displayed:

  • I wanna be your first string
  • Value of counter increments by 1.
  • counter = 6

7th iteration: counter = 6, following line is displayed:

  • I wanna be your A-Team
  • Value of counter increments by 1.
  • counter = 7
  • The program should keep going to finish out the current verse. So following line is displayed:
  • I wanna be your endgame, endgame
  • The loop breaks as the value of counter = 7 is greater than lines_of_sanity i.e. 6
  • So at last the print("MAKE IT STOP") statement is execute which displays the following line:
  • MAKE IT STOP
  • The program along with the output is attached.

You might be interested in
The extent to which a program satisfies its specificationand fulfills the customer’s mission objectives is said to beachieving t
GuDViN [60]

Answer:

b) Reliability.

Explanation:

When the program gives correct output and fulfills the customer's requirements it is said to be reliable and said to be achieving reliability.

Correctness is when the program only provides correct solution.

Efficiency is when the program does the work in less time.

Usability means that the program is usable or not.

5 0
3 years ago
In this lab, you will create a programmer-defined class and then use it in a Java program. The program should create two Rectang
prohojiy [21]

Answer:

class Rectangle{

//private attributes of length and width

private double givenLength;

private double givenWidth;

// constructor to initialize the length and width

public Rectangle(double length, double width){

 givenLength = length;

 givenWidth = width;

}

// setter method to set the givenlength

public void setGivenLength(double length){

 givenLength = length;

}

// setter method to set the givenWidth

public void setGivenWidth(double width){

 givenWidth = width;

}

// getter method to return the givenLength

public double getGivenLength(){

 return givenLength;

}

// getter method to return the givenWidth

public double getGivenWidth(){

 return givenWidth;

}

// method to calculate area of rectangle using A = L * B

public void calculateArea(){

 System.out.println("The area of the rectangle is: " + getGivenLength() * getGivenWidth());

}

// method to calculate perimeter of rectangle using P = 2 * (L + B)

public void calculatePerimeter(){

 System.out.println("The perimeter of the rectangle is: " + 2 * (getGivenLength() + getGivenWidth()));

}

}

public class MyRectangleClassProgram{

public static void main(String args[]){

//rectangle1 object is created

Rectangle rectangle1 = new Rectangle(10.0, 5.0);

//rectangle2 object is created

Rectangle rectangle2 = new Rectangle(7.0, 3.0);

//area for rectangle1 is calculated

rectangle1.calculateArea();

//perimeter for rectangle1 is calculated

rectangle1.calculatePerimeter();

//area for rectangle2 is calculated

rectangle2.calculateArea();

//perimeter for rectangle2 is calculated

rectangle2.calculatePerimeter();

}

}

Explanation:

Two file is attached: Rectangle.java and MyRectangleClassProgram.java

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
7 0
3 years ago
Which part of project management considers if employees will work at home or in the office?
gregori [183]

Answer: i think its resources

Explanation:

5 0
2 years ago
Read 2 more answers
In this exercise, first run the code as it is given to see the intended output. Then trace through each of the 3 variables to se
dlinn [17]

Answer:

The memory with variable names str1, str2, and str3 all have equal and the same value after the first if-statement.

Explanation:

The str1 was first assigned a null value while the str2 and str3 were assigned the string value "Karen" with the String class and directly respectively. On the first if-statement, the condition checks if the str1 is null and assigns the value of the variable str2 to str1, then the other conditional statement compares the values of all the string variables.

3 0
3 years ago
What is the current through R1?
patriot [66]
I = V/R. So the answer is 9/200 = 0.045A = 45mA which is B
8 0
2 years ago
Other questions:
  • Which result would support the particle theory of light?
    6·2 answers
  • Why was the movable type of the printing press such a breakthrough for publishing?
    15·2 answers
  • Can someone help me with...A table can help? PLEASE
    8·1 answer
  • Jessica finds out that the government introduced a new trade policy that will increase import tariffs. She calls for a meeting o
    15·1 answer
  • A ___________ is the smallest unit in a written language.
    7·2 answers
  • Write a C++ program to find if a given array of integers is sorted in a descending order. The program should print "SORTED" if t
    14·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • Which of the following statements holds true for the term plug-in? Group of answer choices It refers to a program (typically a m
    11·1 answer
  • HELP 20 points THIS IS ON EDGE IF YOU DON'T KNOW THE ANSWER DON'T RESPOND
    12·2 answers
  • You are working at the help desk and you get a message that a user cannot access the internet. you open a command prompt, ping t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!