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
kolezko [41]
3 years ago
6

Read the Python program below: num1 = int(input()) num2 = 10 + num1 * 2 print(num2) num1 = 20 print(num1) Question 1 When this p

rogram is executed, if the user types 10 on the keyboard, what will be displayed on the screen as a result of executing line 3? A. 30 B. 40 C. 10 + 10 * 2 D. 10 + num1 * 2
Computers and Technology
1 answer:
Nookie1986 [14]3 years ago
6 0

Answer

B. 30

Explanation:

Assuming the code is written like this:

1. num1 = int(input())

2. num2 = 10 + num1 * 2

3. print(num2)

4. num1 = 20

5. print(num1)

Line 3 will print 30 when the number 10 is inputted at line 1.

Remember to use Order of Operations! :)

You might be interested in
g Define memory hierarchy. A. The rate at which information can be transferred from one place to another. B. Ordering storage sy
andrew-mc [135]

Answer:

The correct option is B.

Explanation:

Memory hierarchy is the ordering of storage systems according to their speed, capacity and cost.

The hierarchy consist of Register as the top, followed by cache, then main memory, secondary memory and external storage. As you go down the hierarchy, the speed decreases, the size increases and the cost decreases also.

Memory hierarchy diagram is attached for reference.

3 0
3 years ago
Select the correct answer.
Svetradugi [14.3K]

Answer:

C. Universal

Explanation:

7 0
3 years ago
Easy STEAM question :)
lorasvet [3.4K]

Answer:

Explanation:

A civil Engineer builds buildings, roads and bridges.

4 0
4 years ago
Read 2 more answers
Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since th
vovangra [49]

Complete Question:

Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode.

Group of answer choices;

A. Reboot into Safe Mode

B. Run compatibility mode for 640 x 480 resolution.

C. Reduce her screen resolution to 640 x480

D. Reboot into Low Resolution Mode

Answer:

B. Run compatibility mode for 640 x 480 resolution.

Explanation:

In this scenario, Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode. In order to make the games work properly in Windows, Missy should run compatibility mode for 640 x 480 resolution.

The video graphics array (VGA) is the standard graphics or display interface used for computer monitors. It was developed in 1987 by IBM and it had a standard display resolution of 640 x 480 pixels.

<em>Hence, if the output of a software program (games) looks fuzzy or is not being displayed properly, you should run compatibility mode for 640 x 480 resolution. This is to enable low resolution video mode on the computer. </em>

The VGA mode is very basic because only minimal video drivers are being loaded on the windows.

4 0
3 years ago
Please use thread to complete the following program: one process opens a file data.txt, then creates a thread my_thread. The job
Firlakuza [10]

Answer:

Here is the code:-

//include the required header files

#include<stdio.h>

#include<pthread.h>

// method protocol definition

void *count_lines(void *arg);

int main()

{

    // Create a thread handler

    pthread_t my_thread;

    // Create a file handler

    FILE *fh;

    // declare the variable

    int *linecnt;

    // open the data file

    fh=fopen("data.txt","r");

// Create a thread using pthread_create; pass fh to my_thread;

    pthread_create(&my_thread, NULL, count_lines, (void*)fh);

    //Use pthread_join to terminate the thread my_thread

    pthread_join( my_thread, (void**)&linecnt );

    // print the number of lines

printf("\nNumber of lines in the given file: %d \n\n", linecnt);

    return (0);

}

// Method to count the number of lines

void *count_lines(void *arg)

{

    // variable declaration and initialization

    int linecnt=-1;

    char TTline[1600];

    //code to count the number of lines

    while(!feof(arg))

    {

         fgets(TTline,1600,arg);

         linecnt++;

    }

    pthread_exit((void *)linecnt);

    // close the file handler

    fclose(arg);

}

Explanation:

Program:-

8 0
3 years ago
Other questions:
  • Each​ _____ in a relational database table is a unique record of something that users want to track.
    14·1 answer
  • In the CIA Triad, "Confidentiality" means ensuring that data is
    9·1 answer
  • QUICK ANSWER- what is the function of GUI
    6·2 answers
  • How to write a program in java that finds the max number of an array of integers?
    6·1 answer
  • Consider the class ScopeTest defined this way:
    15·1 answer
  • How many bytes are there in 256 Kbytes?
    6·1 answer
  • Which of the following would allow for the QUICKEST restoration of a server into a warm recovery site in a case in which server
    10·1 answer
  • What is the role of consumers in determining what is produced in a market economy
    15·2 answers
  • A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. T
    7·1 answer
  • Software licensed using the Open Software Initiative (OSI) definition
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!