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
Vikki [24]
3 years ago
10

Write a simple nested loop example that sums the even and odd numbers between 5 and 15 and prints out the computation.

Computers and Technology
1 answer:
lianna [129]3 years ago
4 0

Answer:

for e in range(6, 15, 2):

for o in range(5, 15, 2):

calc = e+o

print(e, "+", o, "=", calc)

Explanation:

You might be interested in
What type of font color should Kim select if she chooses a dark-colored design theme for her presentation?
enot [183]

white or light colors

5 0
3 years ago
Read 2 more answers
In this lab, you complete a C++ program that swaps values stored in three int variables and determines maximum and minimum value
Sergio039 [100]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int first = 0,second = 0,third = 0;//defining integer variable  

int temp; //defining integer variable

const string SENTINEL = "done"; // defining a string variable as constant  

string repeat;// defining a string variable  

bool notDone = true; //defining bool variable

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

while(notDone == true)//defining a loop to check the value  

{

if(first > second)//use if to compare first and second value

{

int temp = first;//defining temp to hold first value

first = second;//holding second value in first variable

second = temp;//holding temp value in second variable

}

if(second > third)//use if to compare second and third value

{

int temp = second;//defining temp to hold second value

second = third;//holding second value in third variable

third = temp;//holding temp value in third variable

}

cout << "Smallest: " << first << endl;//print smallest value

cout << "Next smallest: " << second << endl;//print Next smallest value

cout << "Largest: " << third << endl;////print Largest value

cout << "Enter any letter to continue or done to quit: ";//print message

cin >> repeat;//holding string value

if (repeat == SENTINEL)

{

notDone = false;//holding bool value

}  

else //else block

{

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

}

return 0;

}

}

Output:

Please find the attached file.

Explanation:

  • Inside the main method Four integer variable "first, second, third, and temp" is declared in which first three variable is used for input value and temp is used to compare value.
  • In thew next step, two string variable "SENTINEL and repeat" is declared in which "SENTINEL" is constant and a bool variable "notDone" is declared.
  • After input the value from the user-end a loop is declared that compare and swap value and print its value.

6 0
2 years ago
5.8.1 Ghosts Python Codehs
eduard

To use Ghost's Python Codehs, we need to install Pygame, for it to work.

<h3>How to use pygame?</h3>

Pygame has several ways to install. Let's do the installation here from the PyCharm environment itself. In the project interpreter, the new virtual environment is already configured, you click on the plus sign, type Pygame, check if it is this one. There's a lot of Pygame, but it's this one alone, with nothing, version 9.6. Click on it and on the installation package button.

If all goes well, Pygame will be successfully installed, and you will be able to use it in your project.

Learn more about code brainly.com/question/497311

8 0
2 years ago
When testing an abrasive wheel by tapping the wheel gently with a light, non-metallic instrument you notice that the wheel sound
elena-s [515]
No. If it  is cracked or damaged THROW IT AWAY. I can tell you from personal experience, not much worse than a wheel breaking apart while spinning and embedding chunks of the wheel in your chest and face.
3 0
3 years ago
Read 2 more answers
CASE II AziTech is considering the design of a new CPU for its new model of computer systems for 2021. It is considering choosin
34kurt

Answer:

(a)The CPU B should be  selected for the new computer as it has a low clock cycle time which implies that it will implement the process or quicker when compared to the CPU A.

(b) The CPU B is faster because it executes the same number of instruction in a lesser time than the CPU A .

Explanation:

Solution

(a)With regards to  the MIPS performance metric the CPU B should be chosen for the new computer as it low clock cycle time which implies that it will implement the process or quicker when compared to the CPU A and when we look at the amount of process done by the system , the CPU B is faster when compared to other CPU and carries out same number of instruction in time.

The metric of response time for CPU B is lower than the CPU A and it has advantage over the other CPU and it has better amount as compared to CPU A, as CPU B is carrying out more execution is particular amount of time.

(b) The execution can be computed as follows:

Clock cycles taken for a program to finish * increased by the clock cycle time = the Clock cycles for a program * Clock cycle time

Thus

CPU A= 5*10^6 * 60*10^-9 →300*10^-3 →0.3 second (1 nano seconds =10^-9 second)

CPU B= 3 *10^6 * 75*10^-9 → 225*10^-3 → 0.225 second

Therefore,The CPU B is faster as it is executing the same number of instruction in a lesser time than the CPU A

6 0
3 years ago
Other questions:
  • What does the Sort feature do with a database
    13·1 answer
  • What part of a file name does windows use to know which application to open to manage the file?
    13·2 answers
  • Please help me with these questions
    5·1 answer
  • Consider a company that needs to sort an array of structures of type Customer by balance, with the largest balance first. Here i
    10·1 answer
  • What your computer can do to you?
    14·2 answers
  • (1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a
    5·1 answer
  • You are given 6 training examples for a binary classification problem as follows:
    12·1 answer
  • Lin wants to play an online game with her friends. She read the description of the game and knows it contains several features w
    12·1 answer
  • In this section of your final project, you will write a basic script to create and back up files. You will create this script wi
    11·2 answers
  • What is a list of data organized for easy access?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!