1answer.
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
stepan [7]
3 years ago
7

I’m failing this class and i’m stuck on this one, this is the code from the last lesson:

Computers and Technology
1 answer:
serg [7]3 years ago
6 0

lst=([])

def avgGPA(lst1):

   total = 0

   count = 0

   for x in lst:

       if type(x) == int:

           total += x

           count += 1

   return total/count

def GPAcalc(grade, weighted):

   grade = grade.lower()

   dictionary = {"a": 4, "b": 3, "c": 2, "d": 1, "f": 0}

   if weighted == 1 and grade in dictionary:

       lst.append(dictionary[grade]+1)

       return "Your GPA score is: " + str(dictionary[grade] + 1)

   elif weighted == 0 and grade in dictionary:

       lst.append(dictionary[grade])

       return "Your GPA score is: " + str(dictionary[grade])

   else:

       lst.append("Invalid")

       return "Invalid"

classes = int(input("How many Classes are you taking? "))

i = 0

while i < classes:

   print(GPAcalc(input("Enter your Letter Grade: "), int(input("Is it weighted? (1 = yes) "))))

   i += 1

print("Your weighted GPA is a "+str(avgGPA(lst)))

If you need me to change any code, I'll do my best. I hope this helps!

You might be interested in
If the algorithm does not have instructions for unanticipated results, the computer program will a. solve a problem b. start ove
MrMuchimi

Answer: halt, just did the question

6 0
3 years ago
Which shot is not the best for a widescreen image
sasho [114]
Closeup? I think I’m pretty sure but I don’t really know though
7 0
3 years ago
Read 2 more answers
Examples of 15 viruses in computer
Zepler [3.9K]
Computer Viruses:

Morris Worm
Nimda
ILOVEYOU
SQL Slammer
Stuxnet
CryptoLocker
Conficker
Tinba
Welchia
Shlayer

Anti-viruses:

Esafe
Avast
Avira AntiVirus
e Trust Antivirus
Dr Web by
NOD32
F-Secure Antivirus
AVG Anti-virus
.Kaspersky Antivirus
McAfee Antivirus
eScan
PC-Cillin
Symantec Antivirus
8 0
2 years ago
What kind of attack allows for the construction of LDAP statements based on user input statements, which can then be used to acc
abruzzese [7]

Answer:   b. LDAP injection

Explanation:

LDAP (Lightweight Directory Access Protocol ) Injection is defined as

  • an injection attack used by attacker to exploit web based applications by inserting LDAP statements based on user input.
  • It may be possible modify LDAP statements through some techniques if an application fails to properly sanitize user input.

So,<u> LDAP injection</u> is the attack that allows for the construction of LDAP statements based on user input statements, which can then be used to access the LDAP database or modify the database's information.

Hence, the correct option is b. LDAP injection.

4 0
2 years ago
Consider the two computers A and B with the clock cycle times 100 ps and 150 ps respectively for some program. The number of cyc
Kipish [7]

Answer:

Option d) B is 1.33 times faster than A

Given:

Clock time, t_{A} = 100 ps

t_{A} = 150 ps

No. of cycles per instructions,  n_{A} = 2.0

n_{B} = 1.0

Solution:

Let I be the no. of instructions for the program.

CPU clock cycle, f_{A} = 2.0 I

CPU clock cycle, f_{B} = 1.0 I

Now,

CPU time for each can be calculated as:

CPU time, T = CPU clock cycle\times clock time

T_{A} = f_{A}\times t_{A} = 2.0 I\times 100 = 200 I ps

T_{B} = f_{B}\times t_{B} = 1.0 I\times 100 = 150 I ps

Thus B is faster than A

Now,

\frac{Performance of A}{Performance of B} = \frac{T_{A}}{T_{B}}

\frac{Performance of A}{Performance of B} = \frac{200}{150}

Performance of B is 1.33 times that of A

7 0
2 years ago
Read 2 more answers
Other questions:
  • You save $500 in a retirement account at age 25. it increases an average of 10% per year until you are 65. which formula and res
    13·1 answer
  • Joshua is creating his résumé, in which section will he add projects and trainings he was involved in?
    10·1 answer
  • What commands would return all the rows and columns in the ProductCategory table?
    7·1 answer
  • Ancestor(X,father(X)) and ancestor(david,george) is they unify or not
    11·1 answer
  • Has anyone on here heard from lilkoadkmillines?
    10·1 answer
  • Consider two communication technologies that use the same bandwidth, but Technology B has twice the SNR of technology A. If tech
    14·1 answer
  • _____the measuring instrument is not necssery​
    10·1 answer
  • Creating Classes
    10·1 answer
  • Where would you go to access frequently used icons?
    12·2 answers
  • Write any two rules for writing algorithm​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!