answer.
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
kiruha [24]
1 year ago
9

Enter an input statement using the input function at the shell prompt. When the prompt asks you for input, enter a number. Then,

attempt to add 1 to that number, observe the results, and explain what happened.
Computers and Technology
1 answer:
Pavel [41]1 year ago
8 0

Answer:

<u>Explanation:</u>

An input statement using the input function at the shell prompt is as follows:

If a prompt asks for a input, a number is to be added

num = input ('Number: ')

num = num + 1

print(num)

Explanation of results: This gives error at line num= num + 1 as cannot convert int object to str implicitly

You might be interested in
Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga
Alexus [3.1K]

Answer:

  1. def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):
  2.    gallon_used = driven_miles / miles_per_gallon
  3.    cost = gallon_used * dollars_per_gallon  
  4.    return cost  
  5. miles_per_gallon = float(input("Input miles per gallon: "))
  6. dollars_per_gallon = float(input("Input dollar per gallon: "))
  7. cost1 = driving_cost(10, miles_per_gallon, dollars_per_gallon)
  8. cost2 = driving_cost(50, miles_per_gallon, dollars_per_gallon)
  9. cost3 = driving_cost(400, miles_per_gallon, dollars_per_gallon)
  10. print("$ %.2f" % cost1)
  11. print("$ %.2f" % cost2)
  12. print("$ %.2f" % cost3)

Explanation:

The solution is written in Python 3.

Firstly, create a function driving_cost that takes three parameters, driven_miles, miles_per_gallon and dollars_per_gallon (Line 1). In the function, calculate the gallon consumption by applying formula driven_miles / miles_per_gallon and then use it to calculate the cost (Line 2 - 3). Return the cost as output (Line 4).

In the main program, prompt user to input miles per gallon and dollars per gallon and then use these input values as arguments to call the function driving_cost function for three times with each time with different driven_miles value (Line 6 - 11).

At last, use formatted print to display the output to two decimal points (Line 13 - 15).

3 0
2 years ago
Read 2 more answers
One factor affecting digital camera quality is the number of pixels, measured in ____, used to store the data for each image.
Vlada [557]
One factor affecting digital camera quality is the number of pixels, measured in megapixels, use to store the data for each image.
5 0
2 years ago
Read 2 more answers
Cara is cleaning her computer when she notices a loose cable connecting to her printer. Which two ports would the cable most lik
Rudiy27

Answer:

Explanation:

Displayport

3 0
2 years ago
What is the name of the "local user" account involved in the alleged actions (Hint: where in the file structure did you find the
Sunny_sXe [5.5K]

I will assume this is a windows computer

Answer:

  • Disk (Letter)\Users\<"Answer">\Folder\Documents\SuspiciousFile.exe
  • You can use Windows Security Logs to try and find out from what IP address the user you just found logged in from.

Explanation:

The windows user folder has folders that contain each users data, Using the file path of the suspicious file you can figure out which user is associated with the file.

Windows Security Logs collect data on logon attempts so when the user logs in their IP address should be collected in these log files.

8 0
2 years ago
Suppose you are given three data items that indicate a starting index in a list, an array of characters, and an array of link in
Artemon [7]

Answer:

see explaination

Explanation:

INCLUDE Irvine32.inc

;declare the variables

SPACE = 32

startIndex = 1

.data

statement BYTE "The correct sequence of array: ",0

; declare the chars('H','A','C','E','B','D','F','G')

chars BYTE 48h,41h,43h,45h,42h,44h,46h,47h

sizeOfArray = ($ - chars)

links DWORD 0,4,5,6,2,3,7,0

outputArray BYTE sizeOfArray DUP(?)

.code

main PROC

; assign starting index

mov eax,startIndex

; assign offset of array chars

mov ebx,OFFSET chars

; assign the size of the array

mov ecx, sizeOfArray

; assign the offset of array links

mov edi,OFFSET links

; assign the offset of new array

mov esi,OFFSET outputArray

; call the traverseLink procedure

call traverseLink

; display the characters of new array

mov edx,OFFSET statement

call writeString

; assign the offset of new array

mov esi,OFFSET outputArray

; assign the size of the array

mov ecx, sizeOfArray

; call the procedure printArray to print the ordered array

call printArray

exit

main ENDP

traverseLink PROC

forLoop:

; get the character at index eax

mov dl,[ebx+eax]

; assign it to new array

mov [esi] , dl

; get the value at the next index

mov eax,[edi+eax*4]

; goto next location of new array

inc esi

; repeat until ecx=0

loop forLoop

ret

traverseLink ENDP

printArray PROC

forLoop:

; get the character at index eax

mov al,[esi]

; print the character

call WriteChar

; increament esi to get next character

inc esi

; print the space character

mov al,SPACE

call WriteChar

loop forLoop

call Crlf

ret

printArray ENDP

END main

7 0
1 year ago
Other questions:
  • Hybrid processors that can process 32 bits or 64 bits are known by what term?
    8·1 answer
  • Which native windows application allows one to access basic pc settings and controls system info?
    6·2 answers
  • During which stage does the central processing unit analyze the instruction and encode it in the form of a number, and then gene
    12·1 answer
  • Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province
    11·1 answer
  • Write a program to determine all pairs of positive integers, (a, b), such that a &lt; b &lt; 1000 and [a2 + b2 + 1)/(ab) is an i
    13·1 answer
  • Identify two entities and 2 of their attributes from the given scenario.
    9·1 answer
  • Write a program FindDuplicate.java that reads n integer arguments from the command line into an integer array of length n, where
    11·1 answer
  • Question 1 :Which type of unshielded twisted pair (UTP) cable is commonly used for 1000BASE-T Ethernet networks and is often mad
    8·1 answer
  • Justify the statement "The same job title can have different job roles and different qualification criteria in different organiz
    7·1 answer
  • Select the correct navigational path to freeze the top row of your worksheet. Select the panes you wish to freeze. Click the tab
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!