[solved] – Question 97498
When we read code and predict its output, it is called tracing code.
For this lesson you will come up with your own challenging algorithm for other students to trace. It must contain at least 5 if statements and use at least one AND or OR boolean condition. Run it in the sandbox below, then copy and paste your code in Piazza for other students to try.
For this challenge try reading 3 or 4 other students’ code – trace the code and predict what it outputs, then run it in the sandbox to see if you got it right.
Expert Answer
[solved] – Question 97499
7.1 Code Practice: Question 3
In the last problem, we get an error if we enter more than one character at a time. Rewrite the program so that it only calls the ord method if a single character is entered.
Sample Run
Enter a character: *
ASCII #42
Enter a character: exit
Not a character
The previous code was
x = input(“Enter a character: “)
print (“ASCII #” + str(ord(x)))
Expert Answer
[solved] – Question 97517
For this lab you will find the area of an irregularly shaped room with the shape as shown above.
Ask the user to enter the values for sides A, B, C, D, and E and print out the total room area.
Remember the formula for finding the area of a rectangle is length * width and the area of a right triangle is 0.5 * the base * height.
Please note the final area should be in decimal format.
Expert Answer
[solved] – Question 9755
A= {2,4,6,8};
B= {1,2,3,4};
C= A[1] + B[2];
D= A[2] – B[1];
A[3]= ?
B[2]=?
C=?
D=?
A-B=?
Expert Answer
[solved] – Question 9756
The deadline date and time that I give for my assignment, is that in my time zone or in yours?
Expert Answer
[solved] – Question 97600
Come up with a challenging algorithm and it must contain at least 5 if statements and use at least one AND or OR boolean condition.
Expert Answer
[solved] – Question 97602
You should ask the user at least five questions and use if-elif-else statements and give answers depending on how they answer. Some responses should be based on what they type, and some should be based on random numbers.
For example, if they say they are sad, your chatbot might respond “I’m sorry to hear that”.
You could also have a random number generated between 1 and 3 and have a corresponding response depending on the number such as “That is great to hear” or “So interesting”.
Expert Answer
[solved] – Question 97614
1) Display the number of jokes in jokes.txt
2) Ask the user for the number of a joke
3) Display the joke
4) Display the requested joke
5) Display the requested answer
import os
# This program has read/write access to the WORKSPACE directory
jokes_filepath = os.path.join( os.environ[‘WORKSPACE’], ‘jokes.txt’ )
answers_filepath = os.path.join( os.environ[‘WORKSPACE’], ‘answers.txt’ )
# The testing system will let this program know how many lines to expect
num_of_lines = int( input() )
# Copy input into the files. Do not modify!
with open( jokes_filepath, ‘w’ ) as jokes_file:
with open( answers_filepath, ‘w’ ) as answers_file:
for _ in range( num_of_lines ):
jokes_file.write( input() + ‘n’ )
answers_file.write( input() + ‘n’ )
# Write your program below
Expert Answer
[solved] – Question 97644
Program an ATM mechine with the help of arrays and functions. Every thing should be included and Only 5 users can make account … The program only for 5 users
Expert Answer
[solved] – Question 97653
Write a java applet which accepts centimetres as input anddisplys it’s meters
Expert Answer

