Chapter 5 Notes
.docx
keyboard_arrow_up
School
Heritage High School *
*We aren’t endorsed by this school
Course
123
Subject
Computer Science
Date
Jun 11, 2024
Type
docx
Pages
50
Uploaded by BailiffPower14539
Chapter 5
Input Output Device Manager
A computer is a machine for constructing mappings from input to output. – Michael Kirby
1
Michael Kirby cannot be ignored here. Most applications do not do much processing of information. It is all about moving information around. The computer takes in input, moves it, makes it pretty, and then outputs it in another form. As I type this section, I am inputting words through a keyboard, with an occasional adjustment using the mouse, and seeing them on the monitor in the correct place. In between the computer captures the input, stores it in one or more locations applies a simple algorithm to interpret the results and sends it to the graphics port for display. That seems pretty simple. It is not and that is what I will cover in this chapter.
Learning Objectives
After completion of this chapter, you should be able to:
1.
Discuss the importance of input and output to computers.
2.
Summarize key concepts of Input and Output devices on computers.
3.
Describe the critical components of the input and output devices and how they interact.
4.
Discuss problems with input and output and how it can affect a computer
5.
Discuss techniques used to implement input and output.
6.
Analyze performance implications of various input and output buffering alternatives.
Survey Your Thoughts
What are the most important input and output devices on your computer?
Input
a.
Bar Code Reader
b.
Joystick
c.
Keyboard
d.
Light pen
e.
Microphone
1
From https://www.wisefamousquotes.com/quotes-about-input-output
downloaded on 6/15/21
1
Chapter 5 Input Output Device Manager
2
f.
Mouse
g.
Scanner
h.
Touch screen
i.
Track ball
Output
a.
GPS
b.
Headphones
c.
Monitor
d.
Printer
e.
Projector
f.
Sound Card
g.
Speakers
h.
Video Card
3
Chapter 5 Input Output Device Manager
Important is one of those funny words you come across all the time
in this industry. You should be asking questions like important to whom or important for what. Knowing what you are doing will drive what is and what is not important.
Getting back to this survey.
Most common output device would be some type of video display. Most computers are geared to a visual environment so having a video display is common.
For input the most common would be some type of text entry device, such as a keyboard. Though a pointing device is up there as
well.
This part of an Operating System (see Figure 1) is usually either ignored or given only cursory coverage in most Operating System text books. And the reason is clear, in the past most of the software and all of the hardware was considered outside the Operating System. Only a few configuration files were managed by the Operating System. And in the early days of desktop systems (1980s) most of the problems with the computer system came down to input or output issues. These included conflicting interrupts, drivers loaded in the wrong location, improper memory space allocation for the device, and—the big one—an updated driver that doesn’t work with some device. This is where Information Technology professionals spent their time. And many of these were intermittent issues so tracking them down took loads of time. Today the systems have more stability, and we are working with a different construct for organization (I will get to that in this chapter), but the issue of input and output did not disappear from our work.
Figure 1 The Input Output Device Manager Alt Tag. Operating System Notational Diagram highlighting the Input Output Device Manager and Input Output hardware.
In this chapter I will discuss how input and output operates and how it is managed by the Operating System. I will go into detail about the mechanisms used and the storage structures set up to make all these parts function together. As in other chapters some of this is specific to what
Chapter 5 Input Output Device Manager
4
Information Technologists do, but all of it will go into topics that may be applied to other aspects
of your work. I will discuss:
Overview of Input and Output—why we have input and output, the challenges input and output afford the Operating System and the computer, the objectives for input and output and how it all fits.
Input and Output Features—the wide range of devices out there and the challenges that presents to the system and everything connects to each other.
Operating System Organization—what hardware and software is needed and how it is organized.
Support Structures—what commands are used and information is stored
Communication with Input and Output—how commands get from the microprocessor to the individual devices.
Technology to Improve Input and Output—techniques that make input and output more efficient or effective or both.
Section 5.1 Overview of Input and Output
Input and Output (I/O) consists of the physical devices, the connections, the support equipment, and the software that interprets the machine’s commands into the intricacies that direct and monitor the individual devices. In most computers, input and output takes up the majority of space. For example, Figure 2 shows a middle of the road motherboard for a desktop system. At the time of purchase this motherboard went for about $200 on the retail market. I will use this motherboard throughout this chapter to discuss concepts. Notice that only one small (well relatively small compared to the board as the microprocessor chip is about 2 inches on a side) area is devoted to the CPU and the rest of the board is for input and output. This board takes up about 10% of the space in an enclosure (a fancy name for a box—but it is the industry term). The
enclosure also houses the power supply, a box about 5 x 8 x 3 inches, and a few fans to keep everything cool. The rest is devoted to input or output.
5
Chapter 5 Input Output Device Manager
Figure 2 ASRock Z270 Extreme Motherboard Alt Tag. Component side of the ASRock Z270 Extreme Motherboard
5.1.1 Why have Input and Output
The computer does nothing without input and output. Without input the computer can only execute a program that does the same thing—repeatedly. Input changes the nature of the program. Even a simple calculator cannot perform a calculation without input. Sure, we can write a program to add the numbers 2 and 3, but once you get 5 the first time, what is the point. Why spend all that time and money to write a program to do just that. Just get a piece of paper and write the number 5. With input I can make the calculator do any manner of calculation and get different, unique, results as my need calls upon them. With output I can actually see what I am doing.
Thus, the CPU needs data. This data comes from the outside world. To get it into the CPU we need input devices. To see the results, we need output devices. The most basic personal computer
has a keyboard, storage device, and a display. One of the simplest systems ever built was the Commodore VIC-20. It came with a keyboard, an Rf
2
coupler, a cassette tape drive, and wires. The keyboard was a box that contained the power supply and CPU. You connected the Rf coupler to the keyboard with a wire and to your television antenna terminal with another wire, the cassette tape drive connected to the keyboard with a wire, then you plugged the Keyboard into a home outlet and turned the ON/OFF switch to the ON position. Then dialed your television into the channel listed on the Rf coupler. This usually got you an error telling you to load the proper cassette tape into the drive and you started again. To give you a feel for this system, it was a $300 computer (then-year dollars, that would be about $800 today) using a 6502
microprocessor (8-bit CPU) that was capable of addressing 32kB of main memory. It came with 20 kB of ROM and 5 kB RAM. It came out in 1980 in an attempt to capture the home market. Prior to that, Commodore’s earlier system (1977), the Commodore Pet was a single box machine
with keyboard, display, and cassette tape drive all in one. The monitor drove the price out of the home market. The Apple II and Radio Shack’s TRS-80 had similar set ups.
Thought Question: List all the computer input devices you can think of?
ble 1 shows a brief list of input devices.
2
Rf for Radio Frequency. As in a television channel.
Chapter 5 Input Output Device Manager
6
Table 1 Input Devices
10-key device
Joystick
Punched Card Reader
3D Scanner
Keyboard
Pyrometer
Barcode Ready
Kinect Sensor
Scanner
Camera
Media Player
Tachometer
Digital Pen
Microphone
Touch pad
Gamepad
Mouse
Touch screen
Humidistat
Paddle
Trackball
Jog Dial
Pointing Stick
Tracker
Thought Question: List all the computer output devices you can think of?
Table 2 shows a brief list of output devices.
Table 2 Output Devices
Actuator
3
Printer
Speakers
Monitor
Punched Cards
Thought Question: List all the computer devices missing from your input and output list?
3
This one is lumped and anything that does something is an actuator. Thus, anti-lock brakes and a machine shop lathe are both considered actuators.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
USING "images" module
from images import Image
Write a python program, to create a collage of the same image at a minimum of four
times and it can fit onto any background image you choose. One of those four copies
must be the original picture. See examples on the next couple of pages.
arrow_forward
Virus DNA files
As a future doctor, Jojo works in a laboratory that analyzes viral DNA. Due to the pandemic During the virus outbreak, Jojo received many requests to analyze whether there was any viral DNA in the patient. This number of requests made Jojo's job even more difficult. Therefore, Jojo ask Lili who is a programmer for help to make a program that can read the file containing the patient's DNA data and viral DNA and then match them. If on the patient's DNA found the exact same string pattern, then write to the index screen the found DNA. Data contained in the file testdata.in
Input Format
The first line of input is the number of test cases TThe second row and so on as many as T rows are the S1 string of patient DNA and the S2 string of viral DNA separated by spaces
Output Format
The array index found the same string pattern.
Constraints
1 ≤ T ≤ 1003 ≤ |S2| ≤ |S1| ≤ 100|S| is the length of the string.S will only consist of lowercase letters [a-z]
Sample Input (testdata.in)…
arrow_forward
Python Programming
Write a python program that doesn't use any special libraries aside from numpy that takes an image.raw and performs histogram equalization and then exports it as a raw image
arrow_forward
Only write it in python language
arrow_forward
Part 6: Boolean Logic Expressions
Boolean expressions are types of logical operations that we can perform on true and false values. Note that the word Boolean is always capitalized because it was named after its inventor, George Boole. Boolean algebra is a very important topic in computer science, and if you haven't learned it before you definitely will in the future. However, for our purposes we are only interested in how we can use them to manipulate binary numbers. The way we use them on binary numbers is by treating 1 as true and 0 as false. From this point on I will be using 0 and 1 instead of false and true.
There are many types of Boolean expressions, but the three most important ones are AND, OR, and NOT.
AND takes 2 operands and will output 1 if they are both 1, or 0 otherwise
OR takes 2 operands and will output 1 if either one is 1, or 0 if neither is 1
NOT takes 1 operand and reverses it: 1 becomes 0, and 0 becomes 1
We can represent this behavior using something called a…
arrow_forward
Question m .In C programming Language
Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line
arrow_forward
Question 4 - Algorithm Design
Imagine you are a treasure hunter standing at one side of the river. There are n (a positive
integer) stones on the river. They are aligned on a straight line and at the nth stone, there is
treasure waiting for you. Your target is to reach the nth stone. For each move, you have the
choice of either walking (move one stone ahead) or leaping (move two stones ahead). Also, you
are not allowed to travel backwards. Design an algorithm that calculates the number of ways
(sequences of walks/leaps) that get you to the treasure stone. You should clearly explain the
algorithm and demonstrate the correctness of the algorithm with a complete proof.
Here is an example. For n =
1
5, there are 8 ways:
Method 1: walk → walk → walk → walk → walk
Method 2: walk → walk → walk → leap
Method 3: walk → walk → leap → walk
Method 4: walk → leap → walk →
walk
walk
Method 5: leap → walk → walk →
Method 6: leap → leap walk
Method 7: leap → walk → leap
Method 8: walk → leap leap
arrow_forward
Python Algorithms
Part 1 – Binary SearchLet's play a little game to give you an idea of how different algorithms for the same problem can have wildly different efficiencies. If I choose an integer from 1 to 16 and ask you to guess what the number is, you can keep guessing numbers until you hit on it. When you guess wrong, I tell you whether you are too high or too low. Once you've guessed the number, think about the technique you used to decide each of your next guesses.If you guessed 1, then 2, then 3, then 4, and so on, until you guessed the right number, you used an approach called “linear search,” meaning you guessed the numbers serially and sequentially, as if they were lined up in a row. This is definitely one way to find the mystery number, but it could require as many as 16 guesses. However, you could get lucky, if the number was 1, you’d only need 1 guess. Using a linear search process, on average, you'd need 8 guesses.There is an approach that is more efficient than just…
arrow_forward
grok
Introduction to Programming (Python)
academy
8 - Looping and lists
Yuor biran is an azamnig thnig
Instructions Tutoring
O Problem
pi
Image source
na
Two words are anagrams of each other if they contain the same letters in them. So
na
left is an anagram of felt and vice-versa. A Super Anagram is a special kind of
So
anagram. A Super Anagram is an anagram whose first and last letters are the same.
So
if
Your program needs to read in two words on a single line. If the pair of words are Super
Anagrams of each other, print out Super Anagram!. If the pair of words is not a Super
Anagram (so a human couldn't read it), then print out Huh?. For one-letter words, the
first letter is the last letter.
So, for example:
Enter words: brain brian
Super Anagram!
and another example:
Enter words: too two
Huh?
arrow_forward
python programming:
Topic: Functional model
Write a program one statement long (it can span multiple lines) that displays the curvature of a sinusoid.
arrow_forward
Canvas Login - Santa Monica College
E Quiz: Module 3: Assignment - Loops
G The lecture demonstrated how to read a line wit
Problem Statement
Output Numbers from 1 to N: Write a program that prints out every other number between 1 and N where N is entered by the user. The numbers must be separated by a comma and a space. The last number must not have a comma
following it. The program is repeated until a number smaller than 1 is entered at which point the program outputs "Goodbye!"
Example:
Enter N: 7
1, 3, 5, 7
Enter N: 10
1, 3, 5, 7,9
Enter N: -1
Goodbye!
Partial Solution
Please try to implement the full source code in your IDE first. The solution is partially provided below. Fill in the blanks to complete the missing parts and make sure to not add an empty space before and after the answer.
using namespace std;
int
Int n- 0;
/get a user input for n
cout>
lprintout every other number
(int i- 1;1 <- n; i +- 2){
cout <<
Nprintout a comma after a number but not the last one.
Iffl < n-1){…
arrow_forward
Moon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of
Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your
weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is
6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg.
(a) Number
6.89
Units
percent
(b) Number
i
6.8713e-4
Units
percent
arrow_forward
Scenario Instructions
You are a Mathematics major who has
agreed to teach an elementary school math
class where the students are studying
geometry. They are just starting to learn
about sine, cosine, and tangent.
You've decided that you want to show the
students what these functions look like when
they have been graphed.
Write a Python program to display three
separate graphs for sin, cos, and tan. Add
the ability to show all three graphs on a
single graph with one row and three
columns.
arrow_forward
PYTHON LANGUAGE
2. Cubes and Squares
by CodeChum Admin
You can also make a list of numbers, ey? Let's go and have some fun in tweaking the values of each element, but let's give it some twist to add on some fun to the code.
Let's have a go at it!
Instructions:
An array containing 40 integer elements is already provided for you in the code editor below.
Using loops and conditions, print out the cube of the array element if it is a positive number, and print out the square of the number if it is negative. Each result must be printed out separately by each line.
Output
The squares and cubes of the elements in the array.
4 1 1 8 27 . . .
arrow_forward
Transcribed Image Text
JAVA Programming Problem: In the game of "Assassin's Creed", you control a ship with a cannon which is attacking a large enemy Assassin's Creed, armed with many guns. Your goal is to destroy as many of the guns as possible. The battle field is a 2D Cartesian grid, where your cannon is located at the origin. The enemy Assassin's Creed is a horizontal line segment located from the coordinates (X1, Y) to (X2, Y). There are exactly (X2 - X1 + 1) guns on the ship, located at the integer points (X1, Y), (X1+1, Y), ..., (X2, Y). However, the problem is, you cannot always fire at a gun. There are supernatural rocks located at all points of the battlefield whose X and Y coordinates are both integers. In order to fire successfully at an enemy's gun, the line connecting your cannon and that gun must not go through any rocks. Develop a JAVA code to output the number of the enemy battleship's guns that your cannon can destroy. Test Case Result 1 2 2 -2
arrow_forward
PYTHON PROGRAMMING
Chess Moves Mapper using Shortest path algorithm
As the title indicates, you will need to determine the number of moves it will take for the different chess pieces from their current position to any other tile in the board. While a standard chess board will have an 8 x 8 grid chess board, your code should be able to handle boards of different dimensions.
For this program the board will be blank. The only piece will be the one inputted.
Input Format
s1, s2, x1, y1, piece
All inputs end with a '\n'
s1, s2 - horizontal size and vertical size of the board respectively.
x1, y1 - starting position of the piece. Refer to Figure 3. for coordinate convention
piece - name of the piece. Use the following names. [pawn, rook, knight, bishop, queen, king]
Given the initial starting position of a given piece, you will be asked to determine the minimum number of moves needed to reach any position in the tile. A sample setup is shown below as well as a visualization of the…
arrow_forward
fast please
arrow_forward
please code in python
You place a pawn at the top left corner of an n-by-n chess board, labeled (0,0). For each move, you have a choice: move the pawn down a single space, or move the pawn down one space and right one space. That is, if the pawn is at position (i,j), you can move the pawn to (i+1,j) or (i+1, j+1).
Ask the user for the size of a chessboard, n (integer). Find the number of different paths starting from (0,0) that the pawn could take to reach each position on the chess board. For example, there are two different paths the pawn can take to reach (2,1). Look at the diagrams below to convince yourself of this. You can see the four paths that you can take by move 2.
Start -> Move 1 -> Move 2
(0,0) -> (1,0) -> (2,1)
(0,0) -> (1,0) -> (2,0)
(0,0) -> (1,1) -> (2,1)
(0,0) -> (1,1) -> (2,2)
Print the board with the number of ways to reach each square labeled as shown below.
For example:
Enter a board size: 4
1 0 0 0
1 1 0 0
1 2 1 0
1 3 3 1
arrow_forward
Number to Words
Instructions
Create a Java program that will convert a
given long value to its equivalent word value
using Map.
arrow_forward
Background and formula:
Ellipse has two types of axis - Major Axis and Minor Axis. The longest chord of the ellipse is the
major axis. The perpendicular chord to the major axis is the minor axis, which bisects the major axis
at the center as shown in Figure 1. Ellipse is different with circle which has only one radius. There is
no simple formula to calculate the exact or accurate value of perimeter of an ellipse. Therefore, we use
approximation formulas to calculate the approximate value of an ellipse's perimeter. One of the
approximation methods is called Ramanujan Formula as follows:
p zn[3(a+b) –
Г(За + b) (а + зь)|
where a is the semi major axis and b is the semi minor axis of the ellipse, respectively, as shown in
Figure 1.
be
major axis
Figure 1. Ellipse
The problem
An input file, data.txt has the following information:
data.txt
4
3
8
4
3
2
7
Write a complete C++ program that read the values of major axis and minor axis from input file,
data.txt; and then compute its perimeter…
arrow_forward
Background and formula:
Ellipse has two types of axis - Major Axis and Minor Axis. The longest chord of the ellipse is the
major axis. The perpendicular chord to the major axis is the minor axis, which bisects the major axis
at the center as shown in Figure 1. Ellipse is different with circle which has only one radius. There is
no simple formula to calculate the exact or accurate value of perimeter of an ellipse. Therefore, we use
approximation formulas to calculate the approximate value of an ellipse's perimeter. One of the
approximation methods is called Ramanujan Formula as follows:
p z n[3(a + b) – (3a + b)(a + 3b)]
where a is the semi major axis and b is the semi minor axis of the ellipse, respectively, as shown in
Figure 1.
b
(major axis
data.txt
4
8
5
7
Write a complete C+ program that read the values of major axis and minor axis from input file,
data.txt; and then compute its perimeter using the Ramanujan Formula. The first column in the input
file is the major axis, while the…
arrow_forward
English Language Calculator
Build a simple “English Language” calculator that does the following:
Takes three inputs from the keyboard
Two of the inputs are single-digit numbers (0 to 9)
The third input is a char from the keyboard, representing one of the five operations from the keyboard:
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
^ (exponentiation)
Output the description of the operation in plain English, as well as the numeric result
Input and Output Instruction for the Calculator
If the two input numbers are 5 and 3, and the operation is *, then the output should be
five multiplied by three is 15
Note that the result is given as a number, not a word.
If the two numbers are 2 and 9, and the operation is -, then the output should be
two minus nine is -7
If the two numbers are 5 and 2, and the operation is ^, then the output should be
five to the power two is 25
Hint: To perform the exponentiation, use the pow method of the Math class.
If the two…
arrow_forward
Python programming: Using Turtle Graphics, Three functions to be developed.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- USING "images" module from images import Image Write a python program, to create a collage of the same image at a minimum of four times and it can fit onto any background image you choose. One of those four copies must be the original picture. See examples on the next couple of pages.arrow_forwardVirus DNA files As a future doctor, Jojo works in a laboratory that analyzes viral DNA. Due to the pandemic During the virus outbreak, Jojo received many requests to analyze whether there was any viral DNA in the patient. This number of requests made Jojo's job even more difficult. Therefore, Jojo ask Lili who is a programmer for help to make a program that can read the file containing the patient's DNA data and viral DNA and then match them. If on the patient's DNA found the exact same string pattern, then write to the index screen the found DNA. Data contained in the file testdata.in Input Format The first line of input is the number of test cases TThe second row and so on as many as T rows are the S1 string of patient DNA and the S2 string of viral DNA separated by spaces Output Format The array index found the same string pattern. Constraints 1 ≤ T ≤ 1003 ≤ |S2| ≤ |S1| ≤ 100|S| is the length of the string.S will only consist of lowercase letters [a-z] Sample Input (testdata.in)…arrow_forwardPython Programming Write a python program that doesn't use any special libraries aside from numpy that takes an image.raw and performs histogram equalization and then exports it as a raw imagearrow_forward
- Only write it in python languagearrow_forwardPart 6: Boolean Logic Expressions Boolean expressions are types of logical operations that we can perform on true and false values. Note that the word Boolean is always capitalized because it was named after its inventor, George Boole. Boolean algebra is a very important topic in computer science, and if you haven't learned it before you definitely will in the future. However, for our purposes we are only interested in how we can use them to manipulate binary numbers. The way we use them on binary numbers is by treating 1 as true and 0 as false. From this point on I will be using 0 and 1 instead of false and true. There are many types of Boolean expressions, but the three most important ones are AND, OR, and NOT. AND takes 2 operands and will output 1 if they are both 1, or 0 otherwise OR takes 2 operands and will output 1 if either one is 1, or 0 if neither is 1 NOT takes 1 operand and reverses it: 1 becomes 0, and 0 becomes 1 We can represent this behavior using something called a…arrow_forwardQuestion m .In C programming Language Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forward
- Question 4 - Algorithm Design Imagine you are a treasure hunter standing at one side of the river. There are n (a positive integer) stones on the river. They are aligned on a straight line and at the nth stone, there is treasure waiting for you. Your target is to reach the nth stone. For each move, you have the choice of either walking (move one stone ahead) or leaping (move two stones ahead). Also, you are not allowed to travel backwards. Design an algorithm that calculates the number of ways (sequences of walks/leaps) that get you to the treasure stone. You should clearly explain the algorithm and demonstrate the correctness of the algorithm with a complete proof. Here is an example. For n = 1 5, there are 8 ways: Method 1: walk → walk → walk → walk → walk Method 2: walk → walk → walk → leap Method 3: walk → walk → leap → walk Method 4: walk → leap → walk → walk walk Method 5: leap → walk → walk → Method 6: leap → leap walk Method 7: leap → walk → leap Method 8: walk → leap leaparrow_forwardPython Algorithms Part 1 – Binary SearchLet's play a little game to give you an idea of how different algorithms for the same problem can have wildly different efficiencies. If I choose an integer from 1 to 16 and ask you to guess what the number is, you can keep guessing numbers until you hit on it. When you guess wrong, I tell you whether you are too high or too low. Once you've guessed the number, think about the technique you used to decide each of your next guesses.If you guessed 1, then 2, then 3, then 4, and so on, until you guessed the right number, you used an approach called “linear search,” meaning you guessed the numbers serially and sequentially, as if they were lined up in a row. This is definitely one way to find the mystery number, but it could require as many as 16 guesses. However, you could get lucky, if the number was 1, you’d only need 1 guess. Using a linear search process, on average, you'd need 8 guesses.There is an approach that is more efficient than just…arrow_forwardgrok Introduction to Programming (Python) academy 8 - Looping and lists Yuor biran is an azamnig thnig Instructions Tutoring O Problem pi Image source na Two words are anagrams of each other if they contain the same letters in them. So na left is an anagram of felt and vice-versa. A Super Anagram is a special kind of So anagram. A Super Anagram is an anagram whose first and last letters are the same. So if Your program needs to read in two words on a single line. If the pair of words are Super Anagrams of each other, print out Super Anagram!. If the pair of words is not a Super Anagram (so a human couldn't read it), then print out Huh?. For one-letter words, the first letter is the last letter. So, for example: Enter words: brain brian Super Anagram! and another example: Enter words: too two Huh?arrow_forward
- python programming: Topic: Functional model Write a program one statement long (it can span multiple lines) that displays the curvature of a sinusoid.arrow_forwardCanvas Login - Santa Monica College E Quiz: Module 3: Assignment - Loops G The lecture demonstrated how to read a line wit Problem Statement Output Numbers from 1 to N: Write a program that prints out every other number between 1 and N where N is entered by the user. The numbers must be separated by a comma and a space. The last number must not have a comma following it. The program is repeated until a number smaller than 1 is entered at which point the program outputs "Goodbye!" Example: Enter N: 7 1, 3, 5, 7 Enter N: 10 1, 3, 5, 7,9 Enter N: -1 Goodbye! Partial Solution Please try to implement the full source code in your IDE first. The solution is partially provided below. Fill in the blanks to complete the missing parts and make sure to not add an empty space before and after the answer. using namespace std; int Int n- 0; /get a user input for n cout> lprintout every other number (int i- 1;1 <- n; i +- 2){ cout << Nprintout a comma after a number but not the last one. Iffl < n-1){…arrow_forwardMoon effect. Some people believe that the Moon controls their activities. If the Moon moves from being directly on the opposite side of Earth from you to being directly overhead, by what percentage does (a) the Moon's gravitational pull on you increase and (b) your weight (as measured on a scale) decrease? Assume that the Earth-Moon (center-to-center) distance is 3.82 x 10° m, Earth's radius is 6.37 x 106 m, Moon's mass is 7.36 x 1022 kg, and Earth's mass is 5.98 x 1024 kg. (a) Number 6.89 Units percent (b) Number i 6.8713e-4 Units percentarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning