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
erik [133]
3 years ago
11

You are going to write a program for Computer test which will read 10 questions from a file, order them randomly and provide the

test to the user. When the user done the program must give the user his final score
Computers and Technology
1 answer:
ollegr [7]3 years ago
3 0

Answer:

from pprint import pprint

import random

match = {

   "mcq1": "a",

   "mcq2": "c",

   "mcq3": "c",

   "mcq4": "d",

   "mcq5": "a",

   "mcq6": "a",

   "mcq7": "a",

   "mcq8": "b",

   "mcq9": "d",

   "mcq10": "a"

}

file = open("test","r")

questions = set()

for i in range(10):

   ques = []

   for line in file:

       if "-" in line:

           break

       else:

           ques.append(line)

   questions.add(tuple(ques))

def quiz(questions, match):

   questions = list(questions)

   marks = 0

   for i in range(10):

       pprint(questions[i])

       mcq = "mcq",str(i+1)

       mcq = list(mcq)

       answer = input("enter your answer: ")

       if answer == match["".join(mcq)]:

           marks += 1

   return marks

print("Your score is: ",quiz(questions, match))

Explanation:

the file which has been loaded is test, and its data is provided below...

mcq1. The device which converts analog signals to digtital signals and vice versa is called.

a) mother board

b) TAP

c) Modem

d) I/O device

-

mcq2. The main components of a computer system are.

a) TAP, CPU, Printer

b) CPU, Input device

c) CPU, ALU, CU

d) CPU , Output device , Memory unit, Control unit

-

mcq3. A source program is a program.

a) writter in machine laguage

b) translated in machine langaue

c) written in high level language

d) required to boot a computer

-

mcq4.Which image format supports transparency in images.

a) PNG

b) GIF

c) JPG

d) A & B

-

mcq5. (10111) 2 = (?) 10.

a) 23

b) 50

c) 24

d) 89

-

mcq6. UNICODE is an example of.

a) character encoding set

b) driver

c) software

d) database

-

mcq7. (10111) 2 = (?) 10.

a) 23

b) 50

c) 24

d) 89

-

mcq8. NTFS stand for.

a) Network File Saving

b) New Technology File System

c) Newt Trend File Saving

d) Non Technology File System

-

mcq9. FF is example of.

a) Octal number system

b) Binary Number System

c) Decimal Number System

d) Hexadecimal number system

-

mcq10. Emails are sent with the help of ?

a) SMTP

b) FTP

c) HTTP

d) UDP

-

You might be interested in
In Python Calculate the BMI of a person using the formula BMI = ( Weight in Pounds / ( ( Height in inches ) x ( Height in inches
makvit [3.9K]

Answer:

weight_pounds=float(input("Enter the weight in pounds:\n"))#taking input of weight.

height_inches=float(input("Enter the height in inches:\n"))#taking input of thye height.

bmi=(weight_pounds/(height_inches**2))*703#calculating the bmi.

print('The body mass index is '+str(bmi))#printing the result.

Ouput:-

Enter the weight in pounds:

207.8

Enter the height in inches :

72

The body mass index is 28.163395061728398

Explanation:

The above written program is in python.First I have taken input from the user of the weight in pounds then taking input of the height in inches.Then calculating the bmi and storing it in the variable bmi.Then printing the bmi in the end.

6 0
3 years ago
write a simple assembly code using 8088 microprocessor instruction set to add two numbers ? please help me if you know :(​
Kay [80]

Answer:

sexxxxx chaaaaat insta id abhilash0351

3 0
3 years ago
What are four different commands in Internet Explorer and identify their keyboard shortcuts
Zigmanuir [339]
<span>Ctrl + Q -  show all tabs
Ctrl + O - open a file
Ctrl + T - Open a New Tab
Ctrl + W -  close a tab

Hope This Helped <3
</span>
6 0
2 years ago
Pascual specializes in fixing computers. He gets great personal satisfaction out of spending hours working on them, and he has a
Nataly_w [17]

Answer:

expert

Explanation:

Based on the information provided within the question it can be said that the Pascual would be considered an expert on computers. In developmental terms, this refers to someone that has a deep understanding in a particular field as well as the skills and experience needed through lots of practice and education in that specific field. Which in this case is computer hardware.

8 0
3 years ago
We informally define the term corresponding element as follows: The first element in an array and the last element of the array
yanalaym [24]

The corresponding element in an array can be written as follows.

The given array is arr[len] whose size is given by integer variable len. We take another integer variable k.

Corresponding element for arr[k] = arr[len-1-k]

This applies for all expressions of k beginning from 0 upto half the size of len, i.e., len/2.

For element, arr[0], the corresponding element is arr[10-1-0] = arr[9].

The above expression is valid if the sum of index of both element and its corresponding element adds upto the index of the last element of the array.

Example: k + (len – 1 - k)  

= k + len – 1 - k

= len – 1

= index of the last element of the array

The number of elements that an array can hold is one more than the index of the last element of the array.

Suppose an array of 10 elements is given. The above expression holds true since first element of the array is always written as arr[0] and last element will be written as arr[9] for an array of 10 elements.

This is illustrated below.

The c++ program to display the element and its corresponding element along with their index is shown below.

#include <iostream>

using namespace std;

int main() {    

   int len=10, arr[len],k;    

   for(k=0; k<len; k++)

   {

       // elements are initialized to twice their index

       arr[k] = k*2;

   }

   cout<<"Element "<<" Index "<<"\t"<<" Corresponding "<<" Index"<<endl;

   for(k=0; k<len/2; k++)

   {

       cout<<arr[k]<<"\t"<<"\t"<<"\t"<<k<<"\t"<<"\t"<<"\t"<<arr[len-1-k]<<"\t"<<"\t"<<len-1-k<<endl;

   }

}

OUTPUT

Element Index    Corresponding   Index

0  0   18  9

2  1   16  8

4  2   14  7

6  3   12  6

8  4   10  5

 

The above program initializes all the elements of the array to twice the value of their corresponding index. Following this, the element, its index, the corresponding element and its index is displayed.

All the above is achieved using for loop. The size of the array and its elements can be changed.

The expression for the corresponding element is thus explained.

7 0
2 years ago
Other questions:
  • Which data type stores images and audio visual clips?
    9·2 answers
  • An element in a web page that connects to a different location in the same page or a different page is a _____.
    8·1 answer
  • What ipconfig command line option can be used to delete cached dns information from memory?​?
    9·1 answer
  • What is the printout of the call nPrint("a", 4)?
    14·1 answer
  • Let’s say you’re publishing a message with the Hootsuite Composer. The message contains a link to a landing page, and you want t
    9·1 answer
  • When was kale discovered?
    9·1 answer
  • Which actions are available in the Trust Center? Check all that apply.
    8·1 answer
  • Create a list of 5 potential jobs that students of computer science can obtain.
    9·2 answers
  • Explain briely what this statement mean.<br>"A byte is equivalent to a character"<br>​
    15·1 answer
  • Chantal has configured the network at her company's new headquarters with a number of VLANs. All devices joined to the individua
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!