330 Words2 Pages

Short Answer 5 & 6
5. What two things must you normally specify in a variable declaration?
You must specify type & name.
6. What value is stored in uninitialized variables?
An uninitialized variable is by default a 0.
Algorithm Workbench 3-10
3. Write assignment statements that perform the following operations with the variable a, b and c.
a) Adds 2 to a and stores the result in b. { b = 2 + a }
b) Multiplies b by 4 and stores the result in a. { a = b * 4}
c) Divides a by 3.14 and stores the result in b. { b = a MOD 3.14 }
d) Subtracts 8 from b and stores the result in a { a = 8 – b }
4. Assume the variables result, w, x, y and z are all integers, and that w=5, x=4, y=8 and z=2. What value will be stored in result in each of the following statements?
a) 12 = x + y
b) 4 = z * 2
c) 2 = y / x
d) 6 = y – z
5. Write a pseudocode statement that declares the variable cost so it can hold a real numbers.
Dim cost1 As Double = 0
6. Write pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.
Dim cost1 As Integer = 0
7. Write a pseudocode statement that assigns the value 27 to the variable count.
Dim count As Integer = 27
8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.
Total = 10 + 14
9. Write a pseudocode statement that subtracts the variable downpayment from the variable total and assigns the result to the variable due.
due = downpayment – total
10. Write a pseudocode statement that multiplies the variable subtotal by 0.15 and assigns the result to the variable totalfee.
First you must make the variables real numbers. example.Dim subtotal As Double = 0
The statement asked for in the question will appear as totalfee = subtotal *

Related

## Pt1420 Unit 7 Homework Test Paper

1011 Words | 5 Pagesa. error c. Decimal b. hexadecimal d. Octal __C__ 77. The number 10-4 evaluates to which of the following? a. 0.000001 c. 0.0001 b. 0.00001 d. 10000 __D__ 78.

## Nt1210 Chapter 1 Review Questions

1419 Words | 6 PagesChapter 1 review questions 1. Which of the following is true about 1 bit? a. Can represent decimal values 0 through 9 b. Can be used to represent one character in the lowercase English alphabet c. Represents one binary digit d. Represents four binary digits 2.

## Nt1310 Unit 1 Data Visualization

3788 Words | 16 PagesThe ﬁrst method is a partitioned barchart where one variable is used to create the bars, speciﬁed by the x parameter, and the other variable is used to partition the bars, speciﬁed by the fill parameter. Notice that two diﬀerent charts can be displayed for a single pair of variables. 9 > qplot(data = mtcars, x = amF, fill=cylF) 15 cylF count 10 4cyl 6cyl 8cyl 5 0 Automatic Manual amF > qplot(data = mtcars, x = cylF, fill=amF) 10 count amF Automatic Manual 5 0 4cyl 6cyl 8cyl

## Nt1330 Unit 5 Lab Report

2218 Words | 9 Pages[2] To remove an element. [3] To display all the elements. [4] Exit Enter your choice: 1 Element to be inserted: 10 Enter your choice: 1 Element to be inserted: 20 Enter your choice: 1 Element to be inserted: 30 Enter your choice: 3 Element present in the Queue are: 10 20 Enter your choice: 2 10 elements is removed Enter your choice: 3 Element present in the Queue are: 20 30 (ii) Write C programs that implement Queue (its operations) using Pointers. PROGRAM #define true 1 #define false 0 #include #include #include struct q_point { int ele; struct q_point* n; }; struct q_point *f_ptr = NULL; int e_que(void); void add_ele(int); int rem_ele(void); void show_ele(); void main() { int ele,choice,j; while(1) { clrscr(); printf("\n\n****IMPLEMENTATION OF QUEUE USING POINTERS****\n"); printf("= = = = = ="); printf("\n\t\t MENU\n"); printf("= = = = = = "); printf("\n\t[1] To insert an element"); printf("\n\t[2] To remove an

## Lab 1.1 Essay

280 Words | 2 PagesThey are equivalent because they represent the powers of 10 3: Based on the breakdown of the decimal and binary systems in this lab, describe the available digit values and the first four digits of a base 5 numbering system. You can use the binary system as a reference, where the available digit values are 0 and 1 and the first four digits are 1, 2, 4, and 8. The digit values in a base numbering system are 1s and 0s. You are using 16, 8, 4, 2, 1 instead of 128, 64, 32, 16, 8, 4, 2, and 1. 4: Using the Internet and the Help files in Excel, explain why creating a converter from decimal to binary would be more difficult to construct.

## Nt1310 Unit 2 Essay

9623 Words | 39 PagesC HA PT ER 2 BASICS 2–1 Manipulating Rightmost Bits Some of the formulas in this section find application in later chapters. Use the following formula to turn off the rightmost 1-bit in a word, producing 0 if none (e.g., 01011000 ⇒ 01010000): x & (x – 1) This may be used to determine if an unsigned integer is a power of 2; apply the formula followed by a 0-test on the result. Similarly, the following formula can be used to test if an unsigned integer is of the form 2 n – 1 (including 0 or all 1’s): x & (x + 1) Use the following formula to isolate the rightmost 1-bit, producing 0 if none (e.g., 01011000 ⇒ 00001000): x & (– x) Use the following formula to isolate the rightmost 0-bit, producing 0 if none (e.g., 10100111 ⇒ 00001000): ¬x &

## Nt1310 Unit 2 Mis

258 Words | 2 Pages1. List two different data types in a database and provide a brief description including an example. Two different data types would be numeric data and character data. Numeric data can be used to perform meaningful arithmetic procedures. For example, a database can have an hours attribute and an scores attribute that hold numeric values.

## Os 571 Process Improvement Plan Paper

801 Words | 4 PagesTo determine the upper bound the average and margin of error are added. To determine the lower bound the average and margin of error are subtracted. The max was determined by inputting the equal sign along with max then selecting the data points. The min is similar, input the equal sign then min and select the data points. The range is determined by subtracting max from the min (6.12-6.03=.09).

## Pt1420 Week 3

855 Words | 4 Pagesx²-2x-13=0 turns into x²-2x=13 to do this add 13 to both sides of the equation. Step two Multiply each term in the equation by four times the coefficient of the x² term. x²-2x=13 turns into 4x²-8x=52 to do this multiply x² by 4. Gives you 4x² then 4*2x=8x and 13*4=52. Step three square the coefficient of the original x term and add it to both

## Mat 540 Week 2 Regression Paper

635 Words | 3 Pagesd. If so, do an OLS regression of Y on X and obtain the usual statistics. Summary statistics, 1974-1986 (T = 13) (Dependent variable): Y | Coefficient | Std. Error | t-ratio | p-value | | Const

### Pt1420 Unit 7 Homework Test Paper

1011 Words | 5 Pages### Nt1210 Chapter 1 Review Questions

1419 Words | 6 Pages### Nt1310 Unit 1 Data Visualization

3788 Words | 16 Pages### Nt1330 Unit 5 Lab Report

2218 Words | 9 Pages### Lab 1.1 Essay

280 Words | 2 Pages### Nt1310 Unit 2 Essay

9623 Words | 39 Pages### Nt1310 Unit 2 Mis

258 Words | 2 Pages### Os 571 Process Improvement Plan Paper

801 Words | 4 Pages### Pt1420 Week 3

855 Words | 4 Pages### Mat 540 Week 2 Regression Paper

635 Words | 3 Pages