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
Write Java code to: {***this is just code fragment (few lines of code) not complete program}
(a) instantiate 2 objects of class circle one with radius 5 and one with radius 7 and color “red”:
(b) instantiate one object of class Student with no parameter:
(c) define and create an array called a3 with 25 elements of type int.
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 4 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
- 1) Write a method in java that performs the union operation on two integer arrays, i.e. it will createa new array that has the values from the two input arrays but with no duplicates.• The method must have the following signature:public static int[] union(int[] a1, int[] a2)• You can assume that no input array element will have a value less than 1.• Your method can return an array that is the same size as the two input arrays puttogether. This will mean, in general, the returned array will have too many elements.This is fine. Any elements you don’t need, you simply set to zero.• Implement this method using Java primitives only. You may use the array lengthproperty.• If you want to implement other methods to help you, you may do so. You must writethe method specified above, but you may write other methods to help you if you wantto. You must show the full implementation of any methods you create, however.arrow_forwardii) In JAVA language input the elements of an integer array A of size 10 and find the count of all hills in the array. A[i] is a Hill if A[i-1]A[i+1]. A[i] >= 0 All elements of the array are unique.arrow_forwardQuestion 3 : (Eliminate duplicates) Write a program Duplicate.java that reads in ten integers in an array T, creates a new array V by eliminating the duplicate values in the array, and displays the result. Here is the sample run of the program: Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 The distinct numbers are: 1 2 3 6 4 5arrow_forward
- Java - Gift Exchange *** Please include UML Diagram and notes in code Minimum requirements are: At least 1 loop An Array or ArrayList At least 3 Java classes Use methods I am trying to make it so that the program will: Prompt for the number of people included in exchange - If not even it will state that there has to be an even number and ask for the number of people included again (loops). Prompt to enter a participant's first name Prompt for the participant's age Print out the random matching of participants so that everyone gets a gift and everyone gives a gift. Please include UML Diagramarrow_forwarda)Develop a method called normalizeGrades() in Java following the details below: The method should accept an array of numeric grades as argument. Each grade in the array is a numeric value (of type double) between 0 to 100. b)The method should create an integer array of grades, following: If a grade in the array is greater than 50, then the method should round the numeric grade to the nearest integer value using Math.round() method, and then again round it to an integer grade to a nearest multiple of 5. If a grade in the array is less than or equal to 50, then the method should round the numeric grade to the nearest integer value using Math.round() method. c)The method should create a character array of letter grades, using a switch statement by translating the integer grades created in (b) to an array of letter grades of type character, following the grade notation: 100 or 95 or 90 85: A 70, 75, 80: B 55, 60, 65: C 50: D 0 to 49: F d)The method should print the integer array of…arrow_forwardpython: numpy def coupons(my_list, on_sale, prices): ''' QUESTION 5 It's the time of week to go grocery shopping again! Given three arrays, one of what's on sale, one of your own list, and one of the prices, return an array of the items on your list that are on sale and more than five dollars. You have MORE coupons than you have groceries on your list- make sure to only use the coupons that correspond to your list. THIS MUST BE DONE IN ONE LINE Hint: use masking and slicing Args: my_list(np.array) on_sale(np.array) prices(np.array) Return: np.array >>> my_list = np.array(["eggs", "2% milk", "green onions", "whole wheat bread", "onions", "spinach", "peanut butter", "boxed spaghetti", "salt and vinegar chips", "alfredo sauce"]) >>> on_sale = np.array([True, False, True, True, True, True, False, False, False, True, False, True, False])…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