
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
1. Write Pseudocode for adding two given numbers
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values for num1, num2.
Step 4: Calculate sum=num1+num2
Step 5: Display sum
Step 6: Stop
2. Write Pseudocode for multiplying two given numbers
Step 1: Start
Step 2: Declare variables num1, num2 and product.
Step 3: Read values for num1, num2.
Step 4: Calculate product=num1*num2
Step 5: Display product
Step 6: Stop
3. Write a Pseudocode that tells a user that the number they entered is not a 7 or a 9
Step 1: Start
Step 2: Declare and Read variable num.
Step 3: If num=7 then got to Step 3.1, Else go to Step 4
Step 3.1: Print “The number you entered is 7”
Step 4: Else if num=9 then go to Step 4.1, Else go to Step 5
Step 4.1: Print “The number you entered is 9”
Step 5: Print ”The number is not 7 or not 9”
Step 6: Stop
4. Write a Pseudocode to calculate the square and cube of a given number.
Step 1: Start
Step 2: Declare variables num,square,cube
Step 3: Calculate square=num*num
Step 4: Calculate cube=square*num CUBE=NUM*NUM*NUM
Step 5: Print square and cube
Step 6: Stop
5. Write a Pseudocode to find sum and average of 3 numbers.
Step 1: Start
Step 2: Declare variables num1,num2,num3, sum,average.
Step 3: Calculate sum=num1+num2+num3
Step 4: Calculate average=sum/3
Step 5: Print sum and average
Step 6: Stop
6. Write a Pseudocode to find the biggest of 2 numbers. A=15 B=10
Step 1: Start
Step 2: Declare and Read variables A and B, Declare BIG.
Step 3: If A>B, then go to Step 3.1 or Else go to Step 4
Step 3.1: Print BIG=A
Step 4: Print BIG=B
Step 5: Stop
7. An employee is given salary based on the number of hours he worked and his pay per hour rate. Write a Pseudocode to calculate salary of an employee.sal=hrs*hr rate=5 *10=50
Step 1: Start
Step 2: Declare variables salary, hours and rate
Step 3: Read variables hours and rate
Step 4: Calculate salary=hours*rate
Step 5: Print salary
Step 6: Stop
8. Write a Pseudocode to calculate Area of a circle(Area).
Step 1: Start
Step 2: Declare variables radius r and Area
Step 3: Read input radius r
Step 4: Calculate Area=3.14*r*r
Step 5: Print Area
Step 6: Stop
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- In what sense does it mean to "choose numbers at random"?arrow_forwardYou will use sequential, selection and repetition programming statements. You will define one integer number: count count will store how many times valid weights and values have been entered. You will define a variety of doubles: weight, value, sum, sumw, avg value will store the input value weight will store the input weight for that value sum will store the running sum of values and weights sumw will store the running of the weights avg will store the weighted average of the 5 numbers and 5 weights input. The running sum will be calculated by this formula: sum = sum + value * weight For example, if the first value and weight pair entered is 4, 1 and second pair is 10, 3: sum = sum + value*weight = 0 + 4*1 sum = 4 + 10*3 = 34 sumw = 1 + 3 = 4 Values and sum are to be input and calculated within a repetition loop: while count < 5 Input value, weight sumw = sumw + weight sum = sum + value * weight count = count + 1 End while Avg is calculated by: avg =…arrow_forwardPART 2: REPETITION CONTROL STRUCTURE (WHILE, DO-WHILE) Instruction: A mathematician named Ulam proposed generating a sequence of numbers from any positive integer N greater than 1 using the following procedure: If N is 1, stop. If N is even, replace it with N/2. If N is odd, replace it with 3 * N + 1. Continue with this process until N reaches 1. Here are some examples of the Ulam sequence for the first few integers. 2, 1 3, 10, 5, 16, 8, 4, 2, 1 4, 2, 1 5, 16, 8, 4, 2, 1 6, 3, 10, 5, 16, 8, 4, 2, 1 Create a java program using while/do-while that accepts as input an integer value N (assume N> 1) and prints out the Ulam sequence that begins with the input value N. Sample Input/Output: Depicted below are sample outputs when the program is executed (the items in bold characters are input from the user, while the items in bold italic are calculated and printed by the program): Input N: 14 Ulam Sequence: 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 Input N: 5 Ulam…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education