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
Wittaler [7]
3 years ago
6

#You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these lines to #assign di

fferent values to the variables. #There's an easy way to do this exercise, and a hard way. For #a hint on the easier way, revisit the sample answers for the #previous coding exercise. # #Above we've created a variable called mystery_string. Write #some code that will print the first letter of the string on #the first line, the first two letters on the second line, #the first three letters on the third line, etc., until it #prints the entire string on the last line. #
Computers and Technology
1 answer:
Musya8 [376]3 years ago
8 0

Answer:

The solution code is written in Python:

  1. mystery_string = "Programming"
  2. output = ""
  3. for x in mystery_string:
  4.    output += x  
  5.    print(output)

Explanation:

Firstly, create a variable mystery_string to hold a random string (Line 1).

Create an output variable to hold an output string (Line 2).

Create a for-loop to traverse the mystery_string character by character (Line 4). In the iteration, get a character from the mystery_string, and concatenate it with output string (Line 5). Print the output string (Line 6) before proceed to the next iteration.

You might be interested in
a) What are the 'interrupts' in a computer system? Describe the approaches to deal with multiple interrupts in a system.b) Analy
Fynjy0 [20]

Answer:

a)

An interrupt is a signal sent to the processor which indicates an event that needs immediate attention.

  • Interrupts are usually sent to CPU by external or I/O devices.
  • This notifies the processor to a high-priority process that requires the current process to be disrupted.
  • Interrupts requests the processor to stop its ongoing operations and run appropriate part of OS.
  • If the request is acknowledged, the processor may respond by halting its current operation, saving its state. Processor then executes a function called an interrupt handler to handle the event that needs attention.
  • This interrupt is temporary, and processor continues normal activities after the interrupt operator stops, unless the interrupt shows a fatal error.
  • The CPU must inform the device that its interrupt request is acknowledged so that it stops sending interrupt signals.
  • Interrupts are usually used for multitasking purposes in real time computers.
  • There are two basic types of interrupts: hardware and software interrupts.
  • A hardware interrupt requests are generated by hardware devices, to indicate that it needs attention from the operating system.
  • Software interrupts are either requested by programs when they want  some service from the operating system or these interrupts are generated by processor itself on executing particular instructions or when certain requirements are met.

Approaches to deal with multiple interrupts:

There are two approaches to handle multiple interrupts.

  1. One approach is to disable interrupts while an interrupt is being processed. A disabled interrupt means that processor will ignore that interrupt request. If during this phase an interrupt happens, it usually remains pending and will be reviewed by the processor after the interrupts has been enabled by the processor. So, when a program is being executed and an interrupt happens, interrupts are disabled immediately.Upon completion of the interrupt handler procedure, interrupts are allowed before the user program resumes, and the processor checks if other interrupts have occurred. This is a simple technique which deals with the interrupts sequentially. But it does not deal with priority requirements.
  2. Second approach is to define interrupt priorities to enable a higher priority interrupt to cause disruption of a lower-priority interrupt handler. For example take a system with 3 I/O devices: printer, disk and communication line with priorities 3,5, and 7. Lets say when a program starts a printer interrupt happens. The execution continues at printer ISR. At some time interval communication interrupt happens whilst this ISR is still executing. Due to the higher priority of the communication line than the printer, the interrupt is accepted and printer routine is interrupted. Its state is placed on stack and now execution resumes at communication line ISR. Now at some time interval the disk interrupt happens while communication routine is still executing. As the priority of disk interrupt is lower so this is held and communication isr execute completely. Suppose communication ISR finishes, then the previous state is resumed which is printer's ISR execution. But as the disk has higher priority than printer, the processor continues execution in disk ISR. After the completion of disk routine execution, the printer ISR is resumed. After the printer ISR execution is completed the control goes back to the user program.

b) Benefits of using multiple bus architecture compared to single bus architecture are as follows:

  • In a multiple bus architecture each pathway is tailored to deal with a specific type of information. This enhances performance as compared to single bus architecture which is used by simple computers to transfer data onto single bus. Performance enhancement is an important reason for having multiple buses for a computer system.
  • Multiple bus architecture allows multiple devices to work at the same time. This reduces waiting time and enhances the speed of the computer as compared to single bus architecture in which all the components share a common bus. Sharing a common bus causes bus contention which results in slowing down the computer and waiting time increases.
  • Having several different buses available allows to have multiple choices for connecting devices to computer system.
  • Bus designs changes, with the introduction of new types and forms from time to time. Multiple bus architecture with several buses can support equipment from different time periods and helps to retain obsolete equipment such as printers and old hard drives, and also add new ones. This is the compatibility benefit of using multiple bus architecture.
  • CPU places heavy load on bus which carries data from memory and peripheral traffic. So nowadays computers take on multi core model with multiple buses required. So multiple bus architecture is a good option for such systems as it carries more amounts of data through the processor with minimum wait time.

3 0
2 years ago
What programs and outher things could i use to start a youtube gameing chanel
Julli [10]
Try icthio.com I use that and its free.Good luck,!
4 0
3 years ago
Suppose x is 1. What is x after x = 1?<br> A. -1<br> B. 0<br> C. 1<br> D. 2<br> E. -2
Dimas [21]

Answer:

its number 10204921094993293959592828358

Explanation:

also 339399393993939399393

8 0
3 years ago
A company is in the middle of an operating system update to Windows 10 from Windows XP, Windows 7, and Windows 8.x. The diverse
Romashka-Z-Leto [24]

Answer:

Option A is the correct option.

Explanation:

The following option is true because when the user or any organization is installing the updates of an operating system and then, some technicians that its failure and they observe that 100% usage of the computer's CPU is done and the user takes the advice of the technicians regarding to the following queries then, they tell them the following problem is that there is an insufficient numbers of the physical processor cores.

8 0
3 years ago
Write a Short note on Importance of being a good child​
marysya [2.9K]

Answer:

<em><u>Understand that people are learning from you in ways that you may never know. Other people need you to be human to the fullest. More importantly, you need yourself to be human to the fullest. When you make mistakes, take responsibility and learn from them.</u></em>

8 0
2 years ago
Read 2 more answers
Other questions:
  • ____ are diagrams used in mathematics and logic to help describe the truth of an entire expression based on the truth of its par
    8·1 answer
  • Select all statements that correctly describe the ramifications of important features supported by modern DBMS.
    15·1 answer
  • Instant messaging is synchronous
    10·1 answer
  • 12. In 2009, __________ of all pedestrian fatalities were caused by impaired drivers
    9·2 answers
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • When naming a file to upload into an assignment in blackboard, it is okay to use special characters?
    13·1 answer
  • An anagram is a word or a phrase made by transposing the letters of another word or phrase; for example, "parliament" is an anag
    7·1 answer
  • You can count on everything online to be 100% accurate. <br> A. FALSE <br> B. TRUE
    11·2 answers
  • If I could make a Short Film on any topic it would be...how could that film change the world?
    9·1 answer
  • PLZ HELP I AM TIMED!!!!
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!