CHAPTER 2: ALGORITHM WORKBENCH (Input, processing, and output)
3. Write assignment statements that perform the following operations with the variables a, b, and c.
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
8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total.
9. Write a pseudocode statement that subtracts the variable downPayment from the variable total and assigns the result to the variable due.
11. If the following pseudocode were an actual program, what would it display? Declare Integer a = 5 Declare Integer b =
…show more content…
Assume the state sales tax is 4 percent and the county sales tax is 2 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the total sales tax).
Hint: Use the value 0.02 to represent 2 percent, and 0.04 to represent 4 percent.
9. Celsius TO Fahrenheit Temperature Converter
Design a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows:
F=9/5C+32
CHAPTER 3 : ALGORITHM WORKBENCH (Modules)
5. Design a module named getNumber, which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference parameter variable.
6. What will the following pseudocode program display? Module main () Declare Integer x = 1 Declare Real y = 3.4 Display x, “ “, y Call changeUS (x, y) Display x, “ “, y
End Module
Module changeUS (Integer a, Real b)
{
Set a = 0 Set b = 0 Display a, “ “, b
}
7. What will the following pseudocode program display?
Declare Integer x = 1 Declare Real y = 3.4 Display x, “ “, y Call changeUS (x, y) Display x, “ “, y
End Module
Module changeUS (Integer Ref a, Real Ref b)
{
Set a = 0 Set b = 0.0 Display a, “ “, b
}
PROGRAMMING EXERCISES (Modules)
6. Body Mass Index
8. Write a line of code that will declare the variable count to be of type int. Don’t initialize.
Yes, cost-benefit is a legitimate tool. “Cost-Benefit Analysis (CBA) estimates and totals up the equivalent money value of the benefits and costs to the community of projects to establish whether they are worthwhile” (An Introduction to Cost Benefit Analysis). But cost benefit analysis is just for calculating the benefit of the company, in a mathematical way. It shouldn’t play in moral deliberation, there is no way to calculate human life or we can say as the potential that human have. We also can see that there is unsatisfactory about the cost-benefit analysis simply by measuring only the benefits of Ford it’s own. In this case, cost-benefit analysis should improve by adding other stakeholder benefit to produce a “win-win”
25 Amount owed. If line 23d is smaller than the total of lines 22c and 24, enter amount owed
A) It is your responsibility to read the assignment carefully and make sure you understand what you need to do and what you should hand in. If you are not sure, check with
b) Let A represent the probability that the sum of the numbers will be greater then 14
List all variables you will use (use valid variable names). Indicate whether the data type is string, integer, or double, and so on.
In this presentation I will be looking at data types and how they can be used and represented.
5. Write the program to implement your algorithm. Test your program using your test cases. Did your program produce the values predicted in your test cases? Explain.
6. Calculate the total cost of each system over a five-year period (cash flow), by year.
In our recent negotiation, my partner Dave and I assumed the roles of Alan Hacker, a computer software developer, and Alan Hacker’s lawyer. Being the lawyer in the negotiation my objective was to avoid litigation with my client’s partner Stanley Star and to aid in the continuation of my client’s co-owned company HackerStar. In addition, I would assist Hacker in coming to an agreement that would be satisfying for him both personally and financially. I felt that Dave and I presented a reasonable argument on Hacker’s behalf and, since I was able to apply some of our class readings during the process, I was overall pleased with the outcome.
5. The check digit is the number which, when added to the total calculated in step 4, result in a
Complete Lab 9.1: Functions in Pseudocode and Visual Basic from the lab manual and submit the following for this lab:
RE = [$1.30 × (1 + 0.060)] / $36.80 + 0.060 = 0.097446 = 9.74 percent (3)
The table below characterises the four main programming paradigms by their descriptions and scenarios in which they are suited to.
Introduction to Software Engineering Somnuk Keretho, Assistant Professor Department of Computer Engineering Faculty of Engineering, Kasetsart University Email: sk@nontri.ku.ac.th URL: http://www.cpe.ku.ac.th/~sk Somnuk Keretho/Kasetsart University Outline of this presentation • • • • • • Scope of Software Engineering Object-Oriented Software Development Software Process Software Life-Cycle Models Object Orientation Software Quality Assessment Reference to Chapter 1/2/3 of “Software Engineering with JAVA”, S.R. Schach, McGraw-Hill, 1997. Somnuk Keretho/Kasetsart University 2 Scope of Software Engineering • Software engineering is a discipline whose aim is the production of fault-free software, that