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
Gennadij [26K]
3 years ago
5

Write code that inserts userItems into the output string stream itemsOSS until the user enters "Exit". Each item should be follo

wed by a space. Sample output if user input is "red purple yellow Exit": red purple yellow
Computers and Technology
1 answer:
Yuki888 [10]3 years ago
8 0

Answer:

The solution code is written in Python:

  1. itemsOSS = ""
  2. userItem = input("Enter an item: ")
  3. while(item != "Exit"):
  4.    itemsOSS += userItem + " "
  5.    userItem = input("Enter an item: ")
  6. print(itemsOSS)

Explanation:

Firstly, we create a variable itemsOSS (intialized it with empty string) and use it as output string stream (Line 1).

Next use input function to prompt user to enter first item (Line 2)

While the item value is not "Exit" (Line 4), append userItem to variable itemsOSS.

When the user enter "Exit", use print function to print the itemsOSS string (Line 8).

You might be interested in
How can you employ one of the most powerful interactive business tools on the Internet today?
Dovator [93]

Answer:start a blog. I read the book.

Explanation:

7 0
4 years ago
OBJECTIVE QUESTIONS
oee [108]

Answer:

A modifier

Explanation:

because this modified a computer keyboard

8 0
3 years ago
1.What is the output of the following program? [10 Marks]namespace ConsoleApp1{class Program{static void Main(string[] args){int
Nataliya [291]

The program outputs the following rectangular array:

0 0 0 0

0 1  2 3

0 2 4 6

0 3 6 9

0 4 8 12

This is the correctly formatted C# program:

namespace ConsoleApp1{

   class Program

   {

       static void Main(string[] args)

       {

           int i, j;    // <em>declare index variables used to iterate over the array A</em>

           int [,] A = new int[5,5];   // <em>create a 5 by 5 array</em>

           

           /*<em> Iterate over the array with the index variables i and j</em>

<em>                and initialize each location A[i, j] with the product </em>

<em>                of i and j.</em> */  

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

           {

               for (j = 0; j < 4; ++j)

               {

                   A[i, j] = i*j;

               }

           }

           

           /* <em>Iterate over the array again. This time, swap locations </em>

<em>                A[i, j] with A[j, i]</em> */

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

           {

               for (j = 0; j < 4; ++j)

               {

                   if (i < 5)

                   {

                       A[j, i] = A[i, j];

                   }

                   else

                       break;

                   

                   // <em>display the current location A[i, j]</em>

                   Console.Write(A[i, j] + " ");

                   

               }

               /* <em>print a newline to prepare for the next line of printing</em>

                   <em>which corresponds to the next column i</em> */

               Console.WriteLine();

                // <em>pause and wait for user keypress before continuing</em>

               Console.ReadLine();

               

               }

           }

       }

   }

When executed, this program simply prints a rectangular array like so;

0 0 0 0

0 1  2 3

0 2 4 6

0 3 6 9

0 4 8 12

Learn more about predicting program output here: brainly.com/question/20259194

6 0
3 years ago
PLEASE PLEASE PLEASE HELP!! WILL GIVE A BRAINLIEST IF UR RIGHT!!
Nataly_w [17]
1. spreadsheet
2. Computers will continue to become smaller in size and become faster

3 0
3 years ago
Given an list of N integers, Insertion Sort will, for each element in the list starting from the second element: Compare the ele
Elena L [17]

Answer:

def insSort(arr):

ct=0;

for i in range(1, len(arr)):

key = arr[i]

j = i-1

while j >=0 and key < arr[j] :

arr[j+1] = arr[j]

j -= 1

ct=ct+1;

arr[j+1] = key

return arr,ct;

print(insSort([2,1]))

Output of the program is also attached.

8 0
4 years ago
Other questions:
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Advancements in technology that might be helpful for individuals who need accommodations to perform computer tasks include _____
    15·2 answers
  • To have the most impact when using email, you should structure your messages so that
    5·1 answer
  • When using a search engine, what is the name of a word or phrase somebody types to find something online?
    12·2 answers
  • Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
    7·1 answer
  • Write the code to replace only the first two occurrences of the word second by a new word in a sentence. Your code should not ex
    15·1 answer
  • What is a geam in the ggplot2 system?
    5·1 answer
  • You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.25
    12·1 answer
  • Complete the statement using the correct term.
    10·1 answer
  • Can somebody please help me with these few questions?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!