What value is stored in uninitialized variables

Assignment Help Data Structure & Algorithms
Reference no: EM132792952

Introduction To Structured Programming

Assignment - Input, Process, Output

1. Give short answers to the following questions:
a. What does a professional programmer usually do first to gain an understanding of a problem?
b. What is pseudocode?
c. Computer programs typically perform what three steps?
d. What does the term user-friendly mean?
e. What two things must you normally specify in a variable declaration?
f. What value is stored in uninitialized variables?

2. Design an algorithm that prompts the user to enter his or her height and stores the user's input in a variable named height.

3. Design an algorithm that prompts the user to enter his or her favourite colour and stores the user's input in a variable named colour.

4. Write assignment statements that perform the following operations with the variables a and b.
a. Adds 2 to a and stores the result in b
b. Multiplies b times 4 and stores the result in a
c. Divides a by 3.14 and stores the result in b
d. Subtracts 8 from b and stores the result in a

5. Assume the variables result, x, y, and z are all integers, and that x = 4, y = 8, and z = 2. What value will be stored in result in each of the following statements?
a. Set result = x + y
b. Set result = z * 2
c. Set result = y / x
d. Set result = y - z

6. Write a pseudocode statement that declares the variable cost so it can hold real numbers.

7. Write a pseudocode statement that declares the variable total so it can hold integers.

8. Initialize the variable with the value 0.

9. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.

10. Write a pseudocode statement that subtracts the variable downPayment from the variabletotal and assigns the result to the variable due.

11. Debug the following code:
a. If the following pseudocode were an actual program, why would it not display the output that the programmer expects?

Declare String favoriteFood
Display "What is the name of your favourite food?" Input favoriteFood
Display "Your favourite food is " Display "favoriteFood"

b. If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can you find the error?

Declare String 1stPrize
Display "Enter the award for first prize." Input 1stPrize
Display "The first prize winner will receive ", 1stPrize

c. The following code will not display the results expected by the programmer. Can you find the error?

Declare Real lowest, highest, average Display "Enter the lowest score." Input lowest
Display "Enter the highest score." Input highest
Set average = low + high / 2
Display "The average is ", average, "."

d. Find the error in the following pseudocode.

Display "Enter the length of the room." Input length
Declare Integer length

Reference no: EM132792952

Questions Cloud

Explain why you made the given particular selections : You will also have to briefly explain why you made those particular selections and explain what you think each work tells people about congruencies.
Social cognitive theories and changing behavior : How do social cognitive theories and changing a behavior reflect on individual characteristics, environmental factors, and reciprocal determinism?
Identify international humanitarian crisis : Identify an international humanitarian crisis that has taken place in the past six months.
How many packets will be required to deliver all web content : You request the Google search homepage, which consists of an HTML webpage and an image (the image that sits above the search box).
What value is stored in uninitialized variables : What does a professional programmer usually do first to gain an understanding of a problem - What two things must you normally specify in a variable declaration
What story tjungurrayi or others is tellin : Australian Aboriginal dreamtime painting at first looks like a non-objective work filled with beautiful patterns. These patterns are really symbols.
Which entries would be made to record a sale : Which of the following entries would be made to record a sale of merchandise on account? A company uses the perpetual inventory method.
Develop a hypothetical architecture with illustrative : Develop a hypothetical architecture with illustrative instruction and data formats, instruction sets, etc., explain the instruction and machine cycles
How you control where information goes : For this discussion board Update the common operational picture (COP). Use the 1st AD ATROPIAN IRON OPORD phase 1 information and the Phase 1 Significant Events

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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