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
9.11: Array Expander
vodka [1.7K]

The Array Expander is an illustration of arrays and functions.

  • Arrays are variables that stores multiple values
  • Functions are named statements that are executed when called

<h3>The Array Expander program </h3>

The Array Expander program written in C++, where comments are used to explain each action is as follows:

#include <iostream>

using namespace std;

//This declares the Array Expander function

int* ArrayExpander(int *oldArr, int size){

   //This declares the new array

   int *newArr = new int[size * 2];

//This iteration sets values into the new array

   for (int i = 0; i < size * 2; i++) {

       if(i < size){

           *(newArr+i) = *(oldArr+i);

       }

       else{

           *(newArr+i) = 0;

       }

   }

//This returns a pointer to the new array

   return newArr;

}

//The main method begins here

int main(){

//This declares the length of the array, N

   int N;    

//This gets input for N

   cin>>N;

   int initArr[N];

//If N is between 1 and 50

   if(N > 0 && N <=50){

//This iteration gets values for the array

       for(int i = 0; i<N; i++){

           cin>>initArr[i];

       }

//This calls the Array Expander function

   int *ptr = ArrayExpander(initArr, N);

//This iteration prints the elements of the new array

   for (int i = 0; i < N*2; i++) {

       cout << ptr[i] << " ";

   }

   }

  return 0;

}

Read more abou C++ programs at:

brainly.com/question/27246607

3 0
1 year ago
What are some examples of environmental technology
Zarrin [17]
Some examples of environmental technology is recycling.
3 0
3 years ago
With a ____ indent, all lines except the first line of the paragraph are indented from the left margin.
hoa [83]

The answer to this question is a hanging indent. A hanging indent is a writing format where in the first line of the text or paragraph is being aligned in the left margin. A hanging indent is also known as the hanging paragraph.  

3 0
3 years ago
Save As .csv .html Worksheet tab Format Cells SUM Function Destination cell Home tab AutoFit A. Applies a border or shading to s
stiv31 [10]

Answer and Explanation:

A.) Format Cells

When the format cells in an Excel then, change an appearance of the number without the changing a number itself. Apply the number formats (0.7, $0.70, 70%, etc) or other formatting (alignments, fonts, borders, etc).

1. Enter a value 0.7 into the cell B2.

By default, the Excel use the General formats (no specific numbers format) for the numbers To apply the number format, use a 'Format Cell' dialog box.  

2. Then, Select the cell B2.

3. Then, Right click, then click the Format Cell (or press the shortcut key CTRL + 1).

The 'Format Cell' dialog box will appears.

4. Then, For example, if you want - select Currency.

Note: The Excel give you the life preview of how a number will formatted.

5. After that, Click OK.

The Cell B2 will still contain the number 0.7. Then you only changed an appearance of the number. Most frequently used a formatting command that are available on Home tab.

6. On Home tab, in a Number group, click percentage symbol to apply the Percentage formats.

7. On Home tab, in Alignment group, center a numbers.

8. On Home tab, in Font group, add the outside border and change the fonts color to the blue.

B). Destination cell

Destination area or Destination cell - A range of the cells that is select to hold a summarized data in the consolidations. The destination area or cell can be on same worksheets as source data or on the different worksheets. Worksheet can contains only the one consolidation.

C). Save As

If you want to save workbook with the different name use File then click on Save As dialog box or use a shortcut key (Alt + F2).

Then, Select a folder that you wants to store a workbook in using Save in the drop-down lists.

Then, Enters a new filename in the File name box at bottom.

D.) .html

Extension of the web page workbooks is .html.

E). SUM

The SUM function is the built in function in the excel which is used to add all the numbers in the range of the cells and returns its result.

F). Home Tab

A clipboard group is on far left side of a Home Tab. It is an often used in the conjunctions with Editing group, which is on far right side of the tab.

G.) .csv

CSV stands for Comma Separated Value.

CSV is the simple file format that is used to store a tabular datas, such as the spreadsheet or the database. A File in the CSV formats can be imported and exported from the programs that stores data in the tables, such as the Microsoft Excel or the OpenOffice Calc.

H). Worksheet tab

.

To Show the Sheet tabs settings is turned off.

Firstly, ensure that Show Sheet tab is enabled or not.

To do, all the other Excel version, click the File >then Options >then Advanced, in the under Display option for the workbook, then ensures that there is the check in a Show sheet tabs box.

I). AutoFit

J). Sum, Product, Power, Sqrt, Quotient, Mod and many others.

There are 300+ formulas in Excel.

5 0
3 years ago
Consider a hard disk with the following specifications :<br> 3.5 in diameter
AnnyKZ [126]

Answer:

usable capacity = 10 GB

Number of cylinders = 256

Block size = 4 KB

(1)Bytes in each cylinder = (10*230)/(256) = (10*222) = 40 MegaBytes

(2)Number of Blocks in each cylinder = (10*222)/(212) = 10K

(3)capacity of one track = 40 MegaBytes/(10*2) = 2 MB

Rotation speed = 3840 RPM

Number of rotations per second = 3840/60 = 64

Transfer rate = (2*64) = 128 MB/sec

Explanation:

6 0
3 years ago
Other questions:
  • Consider this scenario: A major government agency experiences a data breach. As a result, more than 100,000 personal records are
    7·2 answers
  • can An intelligent workplace uses technology to allow workers to be productive whether they are in the office or working from ho
    12·1 answer
  • Technician a says that the above illustration shows one method used to keep the chain tension tight in an indirect drive camshaf
    8·2 answers
  • The term "Cloud" refers to what option(s) below? (Select all that apply)
    13·1 answer
  • Should the use of hacktivists by a country against enemy organizations be considered an act of war? Why or why not? How about th
    8·1 answer
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • Which statement uses the example type of context clue for the underlined word?
    5·2 answers
  • Which of these is an example of input?
    6·1 answer
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • You have implemented an access control method that only allows users who are managers to access specific data. Which type of acc
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!