
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
Programs output????
![public class arrayOutput {
public static void main (String [] args) {
final int NUM_ELEMENTS = 3;
}
Type the program's output
int [] userVals = new int [NUM_ELEMENTS];
int i;
uservals [0] = 3;
userVals [1] = 6;
userVals [2] = 8;
for (i = 0; i < userVals.length; ++i) {
System.out.println (userVals [i]);
?
?
??](https://content.bartleby.com/qna-images/question/0cc153ae-b205-4fb2-9991-7cf6a21d5016/35dccf38-1979-4278-8f99-ea98b47ad7fa/kw8ol58_thumbnail.png)
Transcribed Image Text:public class arrayOutput {
public static void main (String [] args) {
final int NUM_ELEMENTS = 3;
}
Type the program's output
int [] userVals = new int [NUM_ELEMENTS];
int i;
uservals [0] = 3;
userVals [1] = 6;
userVals [2] = 8;
for (i = 0; i < userVals.length; ++i) {
System.out.println (userVals [i]);
?
?
??
Expert Solution

arrow_forward
Step 1: Step 1
Source Code:
1public class arrayOutput {
2
3public static void main (String [] args) {
4
5final int NUM_ELEMENTS = 3;
6
7int [] userVals = new int[NUM_ELEMENTS];
8
9int i;
10
11userVals[0] = 3;
12
13userVals[1] = 6;
14
15userVals[2] = 8;
16
17for (i =0; i<userVals.length; ++i) {
18
19System.out.println(userVals[i]);
20
21}
22
23}
24
25}
Step by stepSolved in 3 steps with 1 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
- Which of the following is a valid function declaration in Python? def myFunc(): O public static void myFunc(): o def int myFunc(): O def myFunc(int x, int y)arrow_forwardJAVA PROGRAM Please Modify this program with further modifications as listed below: The program must pass the test case when uploaded to Hypergrade. ALSO, change the following in the program: System.out.print("Enter a name (or 'QUIT' to exit): "); to: Enter a name to search or type QUIT to exit and take out this: System.out.println(filename + " is missing. Exiting..."); import java.io.*;import java.util.*;public class Main { public static void main(String[] args) { List<String> girlsNames = loadNames("GirlNames.txt"); List<String> boysNames = loadNames("BoyNames.txt"); Scanner scanner = new Scanner(System.in); while (true) { System.out.print("Enter a name (or 'QUIT' to exit): "); String input = scanner.nextLine(); if (input.equalsIgnoreCase("QUIT")) { break; } searchAndDisplay(input, girlsNames, boysNames); } scanner.close(); } private static…arrow_forwardPython: Given the following declarations, what is the value of each of the following boolean expression? valuel, value, done = 5, 10, True • valuel + 5 ! = value2 • valuel >= value2 or done • valuel >= value2 and done • (valuel > value2 or done) and (not done or value2 > valuel)arrow_forward
- python: Which one of the following options best describes a good reason to define functions when writing a program? a. Because you can't do calculations unless you define a function. b. To make your program work, since Python requires programs to include functions. c. Because functions are required to create working software. d. To make it easier to make future changes to code that is used in multiple places. e. To demonstrate to your employer that you know what functions are.arrow_forward4. CODE IN PYTHON Accept 5 integer inputs from the user and print the sum. Different in this exercise is that you cannot trust the user, just like in real life. You must validate that the input is actually an integer and cannot rely on the user always entering integers. If the user enters something other than a valid integer, print an error message and make them enter the number again until they enter 5 integers and you can print the sum.arrow_forwardI need help determing why I cannot get my python code to run properly I am still very new to programming, I have been completeing repairs on my code as they come up as indicated by "visual studio code". I am stuck now and need help getting my program in python to work properly? #the main function def main(): monthlySales = getSales() #call to get sales salesIncrease = getIncrease() #call to get sales increase #this function gets the monthly sales def getSales(): monthlySales = input('Enter the monthly sales $') monthlySales = float(monthlySales) return monthlySales #this function gets the percent of increase in sales def getIncrease(): salesIncrease = input('Enter percent of sales increase. For example 4% should be enter as 4: ') salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease #call to get the store bonus storeAmount = 0 return storeAmount #this function determines the…arrow_forward
- 5- Which part of the following expression is evaluated first by the Python interpreter? (1 + 3 / 5) * 6 - 2 a. 1 + 3 b. 3 / 5 c. 6 - 2 d. 5 * 6arrow_forwardThis program includes a number of int variables: a, b, c, d, e, i, j, and y. Which of these variables could be printed by the first println statement? Which of them could be printed by the second println statement? Which of them could be printed by the third println statement? Which of them could be printed by the fourth println statement? Which of them could be printed by the fifth println statement? Which of them could be printed by the sixth println statement?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