Question

In: Computer Science

The program is not asking y/n :look below Enter your grade:0.00 F Continue (y/n)y Enter your...

The program is not asking y/n :look below

Enter your grade:0.00
F
Continue (y/n)y
Enter your grade:3.33
B+
Enter your grade:
--------------------------------------------

def calci():
    grade = float(input("Enter your grade:"))
    while (grade <= 4):
        if (grade >= 0.00 and grade <= 0.67):
            print("F")
            break
        elif (grade >= 0.67 and grade <= 0.99):
            print("D-")
            break
        elif (grade >= 1.00 and grade <= 1.32):
            print("D")
            break
        elif (grade >= 1.33 and grade <= 1.66):
            print("D+")
            break
        elif (grade >= 1.67 and grade <= 1.99):
            print("C-")
            break
        elif (grade >= 2.00 and grade <= 2.32):
            print("C")
            break
        elif (grade >= 2.33 and grade <= 2.66):
            print("C+")
        elif (grade >= 2.67 and grade <= 2.99):
            print("B-")
            break
        elif (grade >= 3.00 and grade <= 3.32):
            print("B")
            break
        elif (grade >= 3.33 and grade <= 3.66):
            print("B+")
        elif (grade >= 3.67 and grade <= 3.99):
            print("A-")
            break
        elif (grade == 4.00):
            print("A")
            break
        elif (grade == 4.00):
            print("A+")
        else:
            print("Invalid input enter FLOAT only")
        calci()


def main2():
    question = input("Continue (y/n)")
    if question == "n" or question == "N":
        print("Bye")
    elif question == "y" or question == "Y":
        calci()
        main2()
    else:
        print("Invalid Input-Enter either y or n")
        main2()


print("ISQA 4900 quiz")
calci()
main2()
 fix the error

Solutions

Expert Solution

def calci():

grade = float(input("Enter your grade:"))

while (grade <= 4):

if (grade >= 0.00 and grade <= 0.67):

print("F")

break

elif (grade >= 0.67 and grade <= 0.99):

print("D-")

break

elif (grade >= 1.00 and grade <= 1.32):

print("D")

break

elif (grade >= 1.33 and grade <= 1.66):

print("D+")

break

elif (grade >= 1.67 and grade <= 1.99):

print("C-")

break

elif (grade >= 2.00 and grade <= 2.32):

print("C")

break

elif (grade >= 2.33 and grade <= 2.66):

print("C+")

break

elif (grade >= 2.67 and grade <= 2.99):

print("B-")

break

elif (grade >= 3.00 and grade <= 3.32):

print("B")

break

elif (grade >= 3.33 and grade <= 3.66):

print("B+")

elif (grade >= 3.67 and grade <= 3.99):

print("A-")

break

elif (grade == 4.00):

print("A")

break

elif (grade == 4.00):

print("A+")

else:

print("Invalid input enter FLOAT only")


def main2():

question="y"

while(question=="y"):

if question == "y" or question == "Y":

calci()

question = input("Continue (y/n)")

print("Bye..")

print("ISQA 4900 quiz")

main2()

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me


Related Solutions

I need the program to continue asking the user for a positive value and NOT skip...
I need the program to continue asking the user for a positive value and NOT skip to the value for store 2 if a negative value is entered. This is the code so far: Thanks public static void main(String[] args) {           Scanner input = new Scanner(System.in);//scanner        int Store [] = new int[5];//array for five int               for(int i=0;i<5;i++) { // loops until five inputs are entered            System.out.println("Enter today's sale...
Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade...
Lab 3.4 Write a program that determines a student’s grade. The student will enter a grade and the program will determine if that grade is an A, B, C, D, or E. The student can only enter number 0-100. A = 90-100 B = 80-89 C = 70-79 D= 60-69 E = 59 or less Save the file as Lab3.4 and submit the file. Use https://repl.it/ THIS LANGUAGE IS PYTHON Thank you :)
a) write a program to compute and print n, n(f), f(f(n)), f(f(f(n))).........for 1<=n<=100, where f(n)=n/2 if...
a) write a program to compute and print n, n(f), f(f(n)), f(f(f(n))).........for 1<=n<=100, where f(n)=n/2 if n is even and f(n)=3n+1 if n is odd b) make a conjecture based on part a. use java
Python file def calci(): grade = float(input("Enter your grade:")) while (grade <= 4): if (grade >=...
Python file def calci(): grade = float(input("Enter your grade:")) while (grade <= 4): if (grade >= 0.00 and grade <= 0.67): print("F") break elif (grade >= 0.67 and grade <= 0.99): print("D-") break elif (grade >= 1.00 and grade <= 1.32): print("D") break elif (grade >= 1.33 and grade <= 1.66): print("D+") break elif (grade >= 1.67 and grade <= 1.99): print("C-") break elif (grade >= 2.00 and grade <= 2.32): print("C") break elif (grade >= 2.33 and grade <=...
Python Implement a program that starts by asking the user to enter a login id (i.e.,...
Python Implement a program that starts by asking the user to enter a login id (i.e., a string). The program then checks whether the id entered by the user is in the list ['joe', 'sue', 'hani', 'sophie'] of valid users. Depending on the outcome, an appropriate message should be printed. Regardless of the outcome, your function should print 'Done.' before terminating. Here is an example of a successful login: >>> Login: joe You are in! Done. And here is one...
Write a Python Program Continue to ask the user to enter a POSITIVE number until they...
Write a Python Program Continue to ask the user to enter a POSITIVE number until they type DONE to quit. The program should DOUBLE each of the digits in the number and display the original entry AND the SUM of the doubled digits. Hint: Use the // and % operators to accomplish this. Print the COUNT of entries that were invalid Examples: if the user enters 93218, the sum of the doubled digits is 18+6+4+2+16 = 46. User Entry Output...
Write a C++ program that keeps asking user to enter a positive integer number until a...
Write a C++ program that keeps asking user to enter a positive integer number until a sentinel value (999) is entered. Then for each positive number entered by the user, find out how many digits it consists. (Hint: divide a number by 10 will remove one digit from the number. You can count how many divisions it needs to bring the number to 0.) An example of executing such a program is shown below. Note that the user input is...
Does this look correct? Add operation counts - 0.5pt    * f(N) formula (show your work)...
Does this look correct? Add operation counts - 0.5pt    * f(N) formula (show your work) - 0.5pt    * O(N) reduction - 0.5pt public static long sum1(int N)//f(N) = ; O(N) =    {        long opCount = 0;        long sum = 0; //1        opCount++;        opCount++;        opCount++;        for(int i = 0; i < N; i++) //2 + 2N        {            sum++; //N       ...
C++ Code Writing prompt: Grade Calculation: Write a program that asks the user to enter in...
C++ Code Writing prompt: Grade Calculation: Write a program that asks the user to enter in a number greater than or equal to zero and less than or equal to 100. If they do not you should alert them and end the program. Next, determine the letter grade associated with the number. For example, A is any grade between 90 and 100. Report the letter grade to the user.
Write a program in C to grade an n-question multiple-choice exam (for n between 5 and...
Write a program in C to grade an n-question multiple-choice exam (for n between 5 and 20) and provide feedback about the most frequently missed questions. Your program will use a function scan_exam_data to scan and store the exam data in an appropriate data structurer. Use file redirection to input data – do not use fopen() in your code. The first line of input contains the number of students. Second line is number of questions on the exam followed by...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT