Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve all the question and parts in the two pictures by showing all your work and steps. Do not skip any of them, do them

Solve all the question and parts in the two pictures by showing all your work and steps. Do not skip any of them, do them all to get a thumbs up! First picture answer number 1,2, and 3. second picture answer from part a to d.

image text in transcribed

image text in transcribed

Objective The objective of this tutorial is to familiarize yourself with C++ variables, numerical data types, and operations performed on them. First, we will wrap up number systems with negative numbers which describes how signed numbers are stored in binary. In this tutorial, you will discover how to store literal values in variables and how programs evaluate arithmetic expressions on them. This will then be applied to C++ programs requiring mathematical expressions. Negative Numbers The 2's Compliment is used to represent negative numbers in Binary. Find the 2's Compliment for the following integers assuming 8-bits of memory: 1) 010010112 2) - 12010 3) 101101012 Numerical Data Types C++ offers a variety of data types available to the programmer such as numbers. Numerical data types can be represented in two ways: Literal Constant Variables Before a variable can be used, it must be first defined by the programmer. It must also be initialized but this doesn't have to occur at the definition. A variable is defined through assigning it a type and a name. Variable names must abide by the following rules: Numerical Operations Mathematical operations can be performed on both literal constants and variables. Arithmetic operations must be performed on data of the same types. If the types are different, they must either be casted implicitly or explicitly. Implicit casting is done by the compiler while explicit casting is done by the programmer. Examples What is the value assigned to each of the variables after executing the following statements? a) int a (27), b(6), ; c = ba; b) int a (27), b(6); double c; c = a 1 (double) b; c) int a; double b(6), C(18.6); a=c/b; d) int b = 6; double a, c(18.6; (int) 0 / b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago