Concept explainers
Show the output of the following statements;
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Introduction to Programming with C++
Additional Engineering Textbook Solutions
Starting Out with Java: Early Objects (6th Edition)
Starting Out with Python (4th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out With Visual Basic (8th Edition)
Absolute Java (6th Edition)
Problem Solving with C++ (9th Edition)
- All do. Else report.arrow_forwardwhat is MAXNUM constant ?arrow_forwardI want solution flowchart Start Step 1: Declare Student_Name[10], Student_Score[10][5],i=0,j=0,sum=0 Step 2: for i=0 to 9 Step 3: Get Student_Name[i] Step 4: for j=0 to 4 Step 5: Get Student_Score[i][j] Step 6: sum=sum+Student_Score[i][j] Step 7: End for Step 8: Print "Name= ",Student_Name[i] "Average=", (sum/5) Step 9: End for Endarrow_forward
- I want solution flowchart Start Step 1: Declare Student_Name[10], Student_Score[10][5],i=0,j=0,sum=0 Step 2: for i=0 to 9 Step 3: Get Student_Name[i] Step 4: for j=0 to 4 Step 5: Get Student_Score[i][j] Step 6: sum=sum+Student_Score[i][j] Step 7: End for Step 8: if (sum/5) > 90 and (sum/5)<=100 then Step 9: Print "Student Name= ", Student_Name[i] , "Grade= A+" Step 10: End if Step 11: else if (sum/5) > 80 and (sum/5)<=90 then Step 12: Print "Student Name= ", Student_Name[i] , "Grade= A" Step 13: End elseif Step 14: else if (sum/5) > 70 and (sum/5)<=80 then Step 15: Print "Student Name= ", Student_Name[i] , "Grade= B" Step 16: End elseif Step 17: else if (sum/5) > 60 and (sum/5)<=70 then Step 18: Print "Student Name= ", Student_Name[i] , "Grade= C" Step 19: End elseif Step 20: else Step 21: Print "Student Name= ", Student_Name[i] , "Grade= F" Step 22: End else Step 23: End for Endarrow_forward8. Pizza Mario owns a pizzeria. Mario makes all of his pizzas from 10 different ingredients, using 3 ingredients on each pizza. Mario's cousin Luigi owns a pizzeria as well. Luigi makes all his pizzas from 9 ingredients, using 4 ingredients on each pizza. Mario and Luigi have made a bet: Mario believes that customers can order a larger selection of pizzas in his pizzeria than they can order in Luigi's pizzeria. Use functions for this assignment. Implement a factorial() function yourself (do not use the one from the math module) • When choosing k items from n possible items, the number of possibilities can be obtained using the following formula: () n! k!(n-k)! Make a function called choose with two parameters n and k, that implements the above formula. • Write a program that calculates the number of pizzas Mario and Luigi can make. The outcome should look like this: Mario can make 120 pizzas. Luigi can make 126 pizzas. Luigi has won the bet.arrow_forwardQuestion 3: In each case, hoW Would you define a variable, "countvalue", for maximumefficiency, if the possible ranges of variable values are as indicated: a) O or 1, b) 0-15, c) 0-255, countvalue VAR Countvalue VAR Countvalue VARarrow_forward
- 5. calculate_new_balance Given a starting balance (a number), and a list of transaction tuples, calculate the final balance for an account. Transaction tuples are of the shape ("description", amount, "withdrawal") , or ("description", amount, "deposit"). The last entry in the tuple will be either "withdrawal" or "deposit". Every withdrawal decreases the balance of the account by the specified amount, and every deposit increases the balance. The return value is the new account balance, as a number. (which could be negative) Sample calls should look like: >>> calculate_new_balance(100, [("payday", 20, "deposit"), ("new shoes", 50, "withdrawal"), ("illicit winnings", 200, "deposit")]) 270 >>> calculate_new_balance (100, []) 100arrow_forwardYou are given a list of courses that are currently available in Oxford College that looks like the following: courses = ['CSE110','CSE111','MAT620','CSE520','EEE361','CSE650','MAT510']. All courses till 400 level (499) are for the undergraduate students whereas any courses above 500 are for the graduate or masters students. Write a python program that creates a dictionary from the above list where the keys will be each department name (CSE,EEE,MAT for the above example) and their values will be a dictionary of two keys - Undergraduate Courses and Graduate Courses. Each key will have courses that fall in Undergraduate and Graduate level respectively. Sample Input - No need to take input ['CSE110','CSE111','MAT620','CSE520','EEE361','CSE650','MAT510'] Sample Output: (You just have to print the resultant dictionary. No need to follow the pattern below) { 'CSE':{ 'Undergraduate':['CSE110','CSE111'], 'Graduate':['CSE520','CSE650'] },…arrow_forwardWrite a function called ValidSupplier(SupplierID) that takes as its only input a SupplierID. If the supplier exists in the database your function should return True otherwise it should return Falsearrow_forward
- Call the function from a PROCEDURE. Name the procedure findDiscPrice. Allow the user to pass a parameter customer ID (customer_id) to the procedure. Calculate and display the new item price for the customer similar to the example below. Assume we will call the procedure from the following Anonymous Block begin findDiscPrice (1); findDiscPrice (2); findDiscPrice (3); end; Expected output: Customer Doctor Who new item price is 990 Customer Harry Potter new item price is 40 Customer Captain Awesome new item price is 2400arrow_forwardWrite a simple interest function that calculates simple interest with VBA. (can be try at excel.)arrow_forwardsql function related question! Hi, I need to create a function that accepts officer_id and returns the keyword Active or Inactive. If officer_id exists in the system it finds the status of either A or I.(nested if) if the officer is active(a) then based on the last digit of badge number, if last digit is between 0-5 it returns 'ACTIVE ON DESK'. else if the last digit of badge number is greater than 5, it returns 'ACTIVE ON DUTY' If officer is inactive(I ), it returns Inactive. If officer_id does not exist, it returns 'not existing officer'Please help me with this!arrow_forward
- 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