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
- What is the output of the following codes, consider each case independently?
What will be the value of x after the following loop is executed?
x = 0
For i = 1 To 2
For j = 1 To 3
x = x * i * j
Next j
Next i
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 5 steps with 2 images
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
- Write a program that asks the user to enter how many students they have. Use a for loop to iterate through each student. For each student, allow the user to enter as many scores as they want and let them know that entering -1 will indicate the end of entering scores( note: use a while loop with sentinel value). Sum all the scores for each student and display the total on the screen . For example: Student 1 Total score is 340 Student 2 Total score is 200arrow_forwardfor a in range(5,17,3): How many times the loop statement will run?arrow_forwardPlease unroll the following loop three times. What is the benefit of loop unrolling? for (i=0; i<42; i++) { a[i] = b[i] * i;}arrow_forward
- Write a for loop that displays the following set of numbers: 0, 20, 40, 60, 80,…..1000 (Note there is a comma between the numbers but not the last one)explain please.arrow_forwardAbang Mat will give 10% discount to customers who buy more than 100 pieces of satay. The program will: • read the type of satay that the customer would like to buy • print the bill for each customer based on the quantity and discounts. loop to read and process the purchasing information of FIVE (5) customers. You may assume that the users will always key in a correct input, hence Input validation is not needed. A sample output is shown in Figure 1: Welcome to Kedai Sate Abang Mat You are customer number 0:What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:1 Quantity: 12 Bill RM 12.00 Type of Satay Chicken Lamb Quantity: 36 Bill RM 54.00 Price (per stick) RM1.00 RM1.50 Welcome to Kedai Sate Abang Mat You are customer number 1:What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:2 ******* Welcome to Kedai Sate Abang Mat You are customer number 4: What would you like to order? 1. Satay Ayam 2.Satay Kambing Enter your option:1 Quantity:…arrow_forward5. What will be the value of x after the following loop is executed? X = 0 For i = 1 To 2 For j = 1 To 3 X = X +i* j Next j Next iarrow_forward
- Using for loop, write a program that accepts an integer from the user between 100 and 1000 andchecks if it is divisible by 2, 3, 4, 5, 6, 7, 8, 9 and accordingly displays a message to the userarrow_forwardWhich scenario would make sense to implement a for loop? a) b) c) d) Computing the amount of caffeine in an input size cup of coffee Computing how many miles a car can drive with 10 gallons of gas Computing whether 10 numbers are even or odd Computing the number of pizzas to buy with an input number of peoplearrow_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