Activity

  • Vince Louanne Tabilon posted an update in the group Group logo of MT14-CCMT14-CC 3 years, 4 months ago

    Write an original software code for an app for Medical Technology Students.

    import random

    # Medical technology quiz app
    print(“Welcome to the Medical Technology Quiz App!”)

    # Get user input
    topic = input(“Please enter a topic to be quizzed on: “)
    number_of_questions = int(input(“How many questions would you like to answer? “))

    # Define a dictionary of questions and answers
    question_dict = {
    “What is the process of measuring the amount of oxygen and carbon dioxide in the blood called?”: “Blood gas analysis”,
    “What is the name of the process used to detect diseases or conditions by examining cells and tissues under a microscope?”: “Histology”,
    “What is the name of the process used to detect genetic disorders or mutations?”: “Genetic testing”,
    “What is the name of the device that is used to measure the electrical activity of the heart?”: “Electrocardiogram”,
    “What is the name of the device that is used to measure the electrical activity of the brain?”: “Electroencephalogram”,
    “What is the name of the device that is used to measure the oxygen saturation in the blood?”: “Pulse oximeter”
    }

    # Initialize score
    score = 0

    # Generate quiz questions
    for i in range(number_of_questions):
    # Get a random question from the question_dict
    question = random.choice(list(question_dict.keys()))
    # Get the answer to the question
    answer = question_dict
    # Remove the question from the dictionary
    question_dict.pop(question)
    # Get the user’s answer
    user_answer = input(f”{i + 1}. {question} “)
    # Check if the user’s answer is correct
    if user_answer.lower() == answer.lower():
    print(“Correct!”)
    score += 1
    else:
    print(f”Incorrect. The correct answer is {answer}.”)

    # Display the final score
    print(f”Your score is {score} out of {number_of_questions} ({score/number_of_questions*100}%).”)

you're currently offline

0

New Report

Close