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
polet [3.4K]
3 years ago
9

Write assignment statements that perform the following operations with the variables a, b, and c. i. Adds 2 to ‘a’ and assigns t

he result to ‘b’. ii. Multiplies ‘b’ times 4 and assigns the result to ‘a’. iii. Divides ‘a’ by 3.14 and assigns the result to ‘b’. iv. Subtracts 8 from ‘b’ and assigns the result to ‘a’.
Computers and Technology
1 answer:
solniwko [45]3 years ago
3 0
<h2>Answer: </h2>

(i) b = a + 2;

(ii) a = b * 4;

(iii) b = a / 3.14;

(iv) a = b - 8;

<h2>Explanation: </h2><h3>Assumptions and comments; </h3>

=> The code has been written in Java.

=> The variable a, b and c have been declared.

=> The variable c has only been declared but not used since it is not part of the assignment procedures.

<h3>Explanation: </h3>

The following is the assignment statement that;

<em>(i) Adds 2 to ‘a’ and assigns the result to ‘b’</em>

To add a number to another number or variable, the arithmetic operator (+) is used using the following syntax;

[number] [+] [other number]

In our case, the number is variable a and the other number is 2. Therefore, to add these numbers together we write;

a + 2;

Also, assignment in programming languages is done using the (=) operator. For example to assign a number k to a variable m, we write;

m = k

In our case, the result (a + 2) from above is assigned to variable b as follows;

=> b = a + 2

<em>(ii) Multiplies ‘b’ times 4 and assigns the result to ‘a’.</em>

To multiply a number by another number or variable, the arithmetic operator (*) is used using the following syntax;

[number] [*] [other number]

In our case, the number is variable b and the other number is 4. Therefore, to multiply these numbers we write;

b * 4;

Also,

In our case, the result (b * 4) from above is assigned to variable a as follows;

=> a = b * 4

<em>(iii) Divides ‘a’ by 3.14 and assigns the result to ‘b’.</em>

To divide a number by another number or variable, the arithmetic operator (/) is used using the following syntax;

[number] [/] [other number]

In our case, the number is variable a and the other number is 3.14. Therefore, to divide these numbers we write;

a / 3.14;

Also,

In our case, the result (a / 3.14) from above is assigned to variable b as follows;

=> b = a / 3.14

<em>(iv) Subtracts 8 from ‘b’ and assigns the result to ‘a’.</em>

To subtract a number from another number or variable, the arithmetic operator (-) is used using the following syntax;

[other number] [-] [number]

In our case, the number is 8 and the other variable is b. Therefore, to subtract these numbers we write;

b - 8;

Also,

In our case, the result (b - 8) from above is assigned to variable a as follows;

=> a = b - 8;

You might be interested in
the impact of the global digital divide. According to the authors, countries that lag behind the rest of the world’s ICT capabil
kvasek [131]

Answer:

hi

Explanation:

5 0
2 years ago
It is a function that removes an existing file from the server.
kondaur [170]

Answer: A) remove()

Explanation:

 The remove() function removes an existing file from the server but it does not affect the existing directory and file. We can also ease and remove files in the file handling by using the remove() function. And it is built-in function that removes any type of the data from the function by taking values in the parameter whose values are equal with the passing value in the parameter.

7 0
3 years ago
The directory "a" contains its subdirectory "b" and there is no other entry in the directory "a". You want to display "the conte
Svet_ta [14]

The answer assumes that the question is about which command help accomplish display directory contents in Unix-like operating systems.

Answer:

The command is <em>ls</em>.

Explanation:

The command <em>ls</em> (short for <em>list</em>) displays a variety of important information in different ways regarding any directory contents. Because of this, it is probably one of the most used commands in Unix-like operating systems.

Any directory can contain directories and files of different sizes, recently created/modified, attributes like permissions for being accessed, and, with this command, we can see all this information by size, chronologically, by owner, and/or by many more ways.  

In the question, we can accomplish to list that the directory "a" contains its sub-directory "b" and no other entry using the next line of code:

Command-line 1: \\ ls\; a (<em>the command "says": display content of a</em>)

Result: b

The result is only the directory <em>b </em>because there is no other entry in it.

To display more information regarding <em>b</em>, we can use the many options available for the command <em>ls</em>, like <em>-a</em> (all entries), <em>-d</em> (only directories), <em>-l</em> (long listing format), and so on, e.g. ls -a  A (display all entries in directory A, included hidden files).

6 0
3 years ago
PLZZZZ HELPPP and please don’t send a link , Explain how the processing stage contributes to a computer creating an output.
-Dominant- [34]
The output/interpretation stage is the stage at which data is finally usable to non-data scientists. It is translated, readable, and often in the form of graphs, videos, images, plain text, etc.).
3 0
3 years ago
A mismatch between the type of printer connected to a system and the software printer driver installed is an example of a ____.
mixer [17]
ERROR! It is an example of an error
6 0
3 years ago
Other questions:
  • Illustrate the process of using an operating system to manipulate a computer’s desktop, files and disks.
    12·1 answer
  • 안녕하세요! 한국어도 여기서 사용 가능한지 궁금합니다.
    6·2 answers
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • ___ is an example of a function prototype.
    12·1 answer
  • Components that enhance the computing experience, such as computer keyboards, speakers, and webcams, are known as
    7·1 answer
  • Which type of financial institution typically has membership requirements?
    14·1 answer
  • The __________ statement allows you to check for
    7·1 answer
  • Write a method named addCommas that accepts a string representing a number and returns a new string with a comma at every third
    10·1 answer
  • You have recently installed Windows Server 2019 Desktop Experience on a server. Your manager informs you that he needs to extens
    15·1 answer
  • Please help me on this it’s due now
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!