37.0k views
4 votes
Question 1(Multiple Choice Worth 5 points)

(03.01 MC)

Which line of code will only allow a non-decimal point to be stored in a variable?

candyCost = int(input("How much is the candy?"))
candyCost = input("How much is the candy?")
candyCost = float(input("How much is the candy?"))
candyCost = str(input("How much is the candy?"))
Question 2(Multiple Choice Worth 5 points)
(03.01 MC)

Cheri's teacher asked her to write a program using the input() function. What will this allow her program to do?

Add comments to the code
Allow others to understand the code
Display a string on the screen
Make the program interactive
Question 3(Multiple Choice Worth 5 points)
(03.01 MC)

Jabari is writing a program which prompts a user for a value that is negative and has a decimal. Which function should he use?

float()
int()
print()
string()
Question 4(Multiple Choice Worth 5 points)
(03.01 LC)

In programming, what is a string?

A cable that connects a computer to hardware
A method of threading code into a computer
A system of organizing letters alphabetically
A way to store a sequence of letters, numbers, or symbols
Question 5(Multiple Choice Worth 5 points)
(03.01 LC)

Which function converts the user's input to a number without a decimal?

float()
int()
print()
string()

User Johnhunter
by
3.6k points

2 Answers

0 votes
B is the answer lol yeah I had that some answer
User Akshar
by
3.1k points
6 votes

Answer:

b

Step-by-step explanation:

it's not a c or d and now I have to make it 20 characters long so I will do this

User Chetan Kambli
by
3.8k points