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
Question
Expert Solution
arrow_forward
Step 1 Source Code Of Program
public class Main {
public static void main(String[] args)
{
int[] arr = {2, 5, 10, 8 ,18, 24, 3, 48, 30, 9, 12};
int n = arr.length;
for (int i = 0; i < n; i++) {
if (arr[i] % 4 == 0 && arr[i] % 6 == 0)
System.out.println("Four Six");
else if (arr[i] % 4 == 0)
System.out.println("Four");
else if (arr[i] % 6 == 0)
System.out.println("Six");
else
System.out.println(arr[i]);
}
}
}
Step by stepSolved in 3 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 creates an array of integers sine 10. And do the following- a) Ask the user to enter 10 numbers (all > O) one by one and store them in the array. If user enters a number «0 then program should ask user to enter the number again with a message that "Pl enter a number >0" b) Print the smallest number c) Print the largest number d) Print the averagearrow_forwardAskForNumbers Declare an integer array locally with the size of 200. Create a program that asks the user how many numbers the have. Use your getChoice() function from before. Make sure it does not exceed 200 as the locally declared array has the size of 200 Use a for loop and ask the user to enter each value that must be stored in the array Use a second loop to display each number, and also determine the average of all values in the array After the for loop, display the average of all numbers. This program will let you enter a list of numbers into an array. It will then display all of the numbers, and finally display the average of all numbers. How many numbers would you like to enter?5 Please enter a number: 22 Please enter a number: 33 Please enter a number:44 Please enter a number: 55 Please enter a number: 66 lumber 1 is 22 lumber 2 is 33 lumber 3 is 44 lumber 4 is 55 lumber 5 is 66 The average is 44arrow_forwardWrite a program that inputs ten numbers in an array and displays the minimum number.arrow_forward
- Writing a program that inserts an array (A) and then creates a new array (B) that represents the inverse order of the arrayarrow_forwardEnter values from the keyboard into a 3x5 array, find line totals, and print them on the screen. The output format should be as follows. CASE STUDY: 1 of Series a. Line: 2 1 0 3 1 2nd series a Line: 1 4 3 8 1 Series 3 Line: 5 3 0 8 1 ------------------------------- 2 1 0 3 1 = 7 1 4 3 8 1 = 17 5 3 0 8 1 = 17arrow_forwardIn C++ language.arrow_forward
- Write a program that asks the user to enter 15 integers into an array. Then ask the user to enter a search value. If the value exists in the array, the program will remove its first occurrence in the array, shifting each subsequent element forward and adding a zero at the end of the array. The program then will display the final contents of the array.arrow_forwardDesign a program that will use a pair of nested loop to read the company's sales amounts. The details are as follows: -KDS Company has 3 departments: 1. Dept X 2. Dept Y 3. Dept Z. Design a program that will read as input each department's sales for each quarter of the year, and display the result for all divisions. Use a two dimensional array that will have 3 rows and 4 columns and show how the data will be organized. Please provide solution using Python. Thank you.arrow_forwardWrite a program that reads 10 grades from the input and store them in an array. Use the values in the array to calculate the average of 10 marks. The program should then print the difference between each grade and the average.IN C PROGRAMarrow_forward
- Write a program that inputs ten numbers from the user in an array and displays the minimum number.arrow_forwardAn array is given as int x[6] = {19, 10, 8, 17, 9, 15};, what is x[4]arrow_forwardOutput format For each test case, print the minimum number of operations required in a new line. Constraints 1arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_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