What is the function of an operating system

Assignment Help Computer Engineering
Reference no: EM131225312

EXERCISES 1

1. Mark the following statements as true or false.

a. The first device known to carry out calculations was the Pascaline.
b. Modern-day computers can accept spoken-word instructions but cannot imitate human reasoning.
c. In ASCII coding, every character is coded as a sequence of 8 bits.
d. A compiler translates a high-level program into assembly language.
e. The arithmetic operations are performed inside CPU, and if an error is found, it outputs the logical errors.
f. A sequence of 0s and 1s is called a decimal code.
g. A linker links and loads the object code from main memory into the CPU for execution.
h. Development of a C++ program includes six steps.
i. A program written in a high-level programming language is called a source program.
j. ZB stands for zero byte.
k. The first step in the problem-solving process is to analyze the problem.
l. In object-oriented design, a program is a collection of interacting functions.

2. Name two input devices.

3. Name two output devices.

4. Why is secondary storage needed?

5. What is the function of an operating system?

6. What are the two types of programs?

7. What are the differences between machine languages and high-level languages?

8. What is a source program?

9. Why do you need a compiler?

10. What kind of errors are reported by a compiler?

11. Why do you need to translate a program written in a high-level language into machine language?

12. Why would you prefer to write a program in a high-level language rather than a machine language?

13. What is linking?

14. What are the advantages of problem analysis and algorithm design over directly writing a program in a high-level language?

EXERCISES 2

1. Mark the following statements as true or false.

a. An identifier can be any sequence of digits and letters.
b. In C++, there is no difference between a reserved word and a predefined identifier.
c. A C++ identifier can start with a digit.
d. The operands of the modulus operator must be integers.
e. If a = 4; and b = 3;, then after the statement a = b; the value of b is still 3.
f. In the statement cin >> y;, y can only be an int or a double variable.
g. In an output statement, the newline character may be a part of the string.
h. The following is a legal C++ program:
int main()
{
return 0;
}
i. In a mixed expression, all the operands are converted to floating-point numbers.
j. Suppose x = 5. After the statement y = x++; executes, y is 5 and x is 6.
k. Suppose a = 5. After the statement ++a; executes, the value of a is still 5 because the value of the expression is not saved in another variable.

2. Which of the following are valid C++ identifiers?

a. myFirstProgram
b. MIX-UP
c. C++Program2
d. quiz7
e. ProgrammingLecture2
f. 1footEquals12Inches
g. Mike'sFirstAttempt
h. Update Grade
i. 4th
j. New_Student

3. Which of the following is a reserved word in C++?

a. Const b. include c. Char d. void e. int f. Return

4. What is the difference between a keyword and a user-defined identifier?

5. Are the identifiers firstName and FirstName the same?

6. Evaluate the following expressions.

a. 25 / 3 b. 20 - 12 / 4 * 2 c. 32 % 7 d. 3 - 5 % 7
e. 18.0 / 4 f. 28 - 5 / 2.0 g. 17 + 5 % 2 - 3
h. 15.0 + 3.0 * 2.0 / 5.0

7. If x = 5, y = 6, z = 4, and w = 3.5, evaluate each of the following statements, if possible. If it is not possible, state the reason.

a. (x + z) % y b. (x + y) % w c. (y + w) % x d. (x + y) *w
e. (x % y) % z f. (y % z) % x g. (x *z) % y h. ((x *y) *w) *z

8. Given:

int num1, num2, newNum;
double x, y;

Which of the following assignments are valid? If an assignment is not valid, state the reason.

When not given, assume that each variable is declared.

a. num1 = 35;
b. newNum = num1 - num2;
c. num1 = 5; num2 = 2 + num1; num1 = num2 / 3;
d. num1 * num2 = newNum;
e. x = 12 * num1 - 15.3;
f. num1 * 2 = newNum + num2;
g. x / y = x * y;
h. num2 = num1 % 2.0;
i. newNum = static_cast<int> (x) % 5;
j. x = x + y - 5;
k. newNum = num1 + static_cast<int> (4.6 / 2);

9. Do a walk-through to find the value assigned to e. Assume that all variables are properly declared.
a = 3;
b = 4;
c = (a % b) * 6;
d = c / b;
e = (a + b + c + d) / 4;

10. Which of the following variable declarations are correct? If a variable declaration is not correct, give the reason(s) and provide the correct
variable declaration.
n = 12; //Line 1
char letter = ; //Line 2
int one = 5, two; //Line 3
double x, y, z; //Line 4

11. Which of the following are valid C++ assignment statements? Assume that i, x, and percent are double variables.

a. i = i + 5; b. x + 2 = x; c. x = 2.5 *x; d. percent = 10%;

12. Write C++ statement(s) that accomplish the following.

a. Declare int variables x and y. Initialize x to 25 and y to 18.
b. Declare and initialize an int variable temp to 10 and a char variable ch to 'A'.
c. Update the value of an int variable x by adding 5 to it.
d. Declare and initialize a double variable payRate to 12.50.
e. Copy the value of an int variable firstNum into an int variable tempNum.
f. Swap the contents of the int variables x and y. (Declare additional variables, if necessary.)
g. Suppose x and y are double variables. Output the contents of x, y, and the expression x + 12 / y - 18.
h. Declare a char variable grade and set the value of grade to 'A'.
i. Declare int variables to store four integers.
j. Copy the value of a double variable z to the nearest integer into an int variable x.

Reference no: EM131225312

Questions Cloud

How much system memory do you have ram : What type of device(s) are you using for class? For example:desktop computer, laptop, tablet, 2 in 1(laptop and tablet), smartphone etc. What is your operating system? How much system memory do you have (RAM)?
Analyze the role of communication in developing : Analyze the role of communication in developing and maintaining one's self-concept, self-image, and self-esteem. Differentiate appropriate levels of self-disclosure and emotional intelligence in various relationships. Describe strategies for using co..
Principal components of telecommunications networks : "What are the principal components of telecommunications networks and key networking technologies?" Let's begin by describing the features of a simple network.
What are some of the current trends organizations face : What are some of the current trends organizations face with mobile computing security and what are some of the remediation steps companies take to ensure data confidentiality and integrity?
What is the function of an operating system : What is the function of an operating system? What are the two types of programs? What are the differences between machine languages and high-level languages? What is a source program? Why do you need a compiler?
Identify two barriers that influence your critical thinking : Identify two barriers that influence your critical thinking. Include barriers listed in Thinking: An Interdisciplinary Approach to Critical and Creative Thought. Write 100 to 150 words for each barrier, describing them and how you can overcome them..
Dominate the internet and why : Which company and business model do you think is most likely to dominate the Internet and why?
How can social media such as linkedin : How can social media such as LinkedIn, Facebook, and Twitter be used to improve knowledge sharing, build social capital, support innovation, and aid problem solving in one of the following organizational context -
The purpose of the software for an organization : An explanation of how the software is used by organizations to generate value

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design a combinational verilog module

The starter code from the course web page includes test benches for each problem below. For each of the following, please submit the source code for your Verilog module along with a printout or screen capture of waveform plots indicating a success..

  Questionthe averaging algorithm proposed by lamport et al

questionthe averaging algorithm proposed by lamport et al. works for a totally connected network of clocks. will such

  Should the organisation using paas is the best approach

With the business goals and strategy (Erl, Mahmood, & Puttini, 2013, p. 20) are Web-based and mobile applications. Should the organisation using PaaS is the best approach delivery model? Explain why or why not.

  Write a mips assembly language program to recursively

Write a MIPS assembly language program to recursively compute the nth term of Perrin's sequence. n will be input from the keyboard. And please do not copy and paste from google results because I have already tried searching there.

  It discussion

Using the airlines example mentioned above, propose several possible IT solutions and how they would benefit a smaller airline to become more successful or attract more clients.

  Why lexical analysis is separated from syntax analysis

What do you mean by the term aliasing mean?why Lexical analysis is separated from syntax analysis.

  You are working with php a general-purpose server-side

you are working with php a general-purpose server-side scripting language that allows you to add a lot of function

  What are the suitable foreign keys

What are the appropriate primary keys and given the selected primary keys, what are the appropriate foreign keys.

  Convert structure plan into a function m-file

how to Convert the following structure plan into a function m-file with two inputs (M and N).

  Consider the ways in which you can optimize a file

consider the ways in which you can optimize a file in order to reduce file size and maintain quality. What factors would you consider.

  Analyze the monitoring requirements and potential pitfalls

List the activities that will be outsourced, the skills / labor / material required, and the contract type. Analyze the monitoring requirements and potential pitfalls for each selected contract type

  Explain how a dfs can be used to look for cycles in a graph

question 1choose one of the exercised from the award winning book computer science unplugged. record a creative

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd