Literature Notes
Test Prep
Study Guides
Log In
Sign Up
Home
Questions and Answers Archive
Java Programming
October 2022
Java Programming questions and answers in October 2022
1. 2. 3. 4. 5. Help me with these questions, I will definitely write good feedback.. Which of the following exception is thrown in case when the file specified for writing is not found? FileNot...
DO NOT EDIT ANY CLASSES BESIDES GradStudent.java REUScholarship.java ScholarshipSpecification.java Altering the main method will result in a 0. Methods must adhere to proper naming conventions. ...
Great job using the String function. Another fun programming aspect is splicing and manipulating music. I was fortunate enough to work on an equalizer app for a music group once. We had multiple chall...
1. In the Walmart class, declare two instance variables, namely, total and count for calculating the total price and counting the number of items respectively. Then, create a no-argument construc...
. Q1. Given an undirected graph with 10 vertices but 45 edges, which of the following will be true? Select all that apply. A) Every node will have at least one neighbor B) The graph will have duplic...
. Q2. There are N cities, with M roads, where each road connects a pair of cities. You are given city x. We want to see if every city has a direct road leading to x. Return true if this condition...
please explain to me in an in depth step by step explaination. . Consider the Baby class. public class Baby private String firstName; private String lastName; private double weight; // in pound...
7.2 please explain in an in depth step by step explaination . Consider the following code segment. String scream = "We all scream for ice cream"; String v = "aeiou"; ArrayList&...
Please explain to me in an in depth step by step explaination. 7.2 . Consider the following code segment. ArrayList<Integer> list = new ArrayList<Integer>(); list. add(4) ; list. add(6...
7.1 please explain in an in depth step by step explaination . Which of the following statements is invalid (will not compile) when declaring an ArrayList variable? Elimination Tool Select one answer ...
would like to double check the questions . E Ensign Homepage X Quiz: 8.3 Quiz (30 min.) X + X C D ensign.instructure.com/courses/14050/quizzes/186729/take R 94 0O ... LDS FAFSA Student Loan ck Credit...
A 2-dimensional 3x3 array of ints , has been created and assigned to tictactoe . Write an expression whose value is true if the elements of the diagonal that does NOT include the first element of the ...
d.The method addRooms has been provided for you in the README.TXT file of the project for this TMA. Copy this method, which sets up a number of unoccupied rooms, to your Hotel class, so that you can u...
Pls help me Honors Java. 1. Max Method: Write and test a method that returns the value of the largest of3 integers, x, y, z (or returns any one, if they are equal}. Do not use any methods of the Math ...
Capstone Project Overview OpenEdX is an organization dedicated to open-source education and providing institutions with a variety of Learning Management tools. Recently OpenEdX was contracted by learn...
. Question 7 (23 marks) Consider the scenario described below, which involves the application of RESTful web services: We maintain information about a collection of toys on a server and make the rel...
Writ a class named InputChecker that has the following methods, including checking for exceptions where necessary: 1) A method named isLetterString that accepts a String parameter and returns a boo...
Mak a console interface for managing numeric data, consisting of two classes: NApp and NData, both contained in the NApp.java file. NApp is the user interface and manages an array of NData objects. Su...
CSC110AB Names: Chapter 5 Program 1: Writing The Person Class and PersonTester ...
To help verify the user's identity, a program takes a password (set by the user) and a secret code (set by the company). You can see the variable storing the secret code in the program. Write a progra...
Write program in both java and python. This program will allow the user to input a string. Reverse the vowels of that string in the word. For example, if the user inputs "doggy", the output would be "...
I need serious help I have been stuck on a couple coding exercises and don't know what to do. . X1039: Find Last Negative Box The following question makes use of the generic Box class discussed in...
I've been stumped on these coding exercises I have need help . or this question, you will be using the Book and Shelf classes described in the reading assignment. mplement the following method so...
Your supervisor has provided you with the Pet BAG Specification Document PDF. This document reviews Pet BAG's software needs. Review the pet check in and pet check out methods, which are described in ...
Task 4 : Implement WeakClass contains the following method weakMethod4 public static int weakMethod4(boolean a, boolean b, int c, int d, int e) { int result = 0; if (a != b) { ?...
In Java how do you read in data from a CSV file and put it into arrays of different data types. For instance, if I have a CSV file that includes name, age, and weight (String, int, String) and want to...
. ° Keep working on the GradeBook program - Change the class name to GradeBookHW, and save the java file as GradeBookHW.java ' Modify the arrays ' Your gradebook now should have 10 students — mod...
I have a server.py and client.py program that uses zeromq (sockets, tcp://localhost:5555). The client.py takes in three variables, sends it to the server and the server sends a variable back to the cl...
write simple method headers or method signatures for each scenario given below. As an example, if you are asked to write a method header or method signature for a method that reverses an integer, i....
Java A "regularly-modified" password generator will make the first letter of the password lowercase and the last letter uppercase and append the length of the original password to the password. A "sup...
Java allows for methods to be chained together. Consider the following message from the captain of a pirate ship: String msg1 = " Maroon the First Mate with a flagon of water and a pistol! "; W...
Sample run . Instructions Write a program called StocklnvestorXYZ.java (replaced XYZ by your first and last names). Prompt the user to enter number of stock trades n. Then, prompt the user to ...
Fruit Stand Invoice App Use the program I've started in Canvas to complete the methods. You can borrow code from Java 2A & 2B, though you may need minor modifications. Refer to Fruit_J4A.java im...
Budget App In the main method, Write a loop that asks whether the entry is a Deposit, an Expense, or X to exit. Then call a method called enterDeposit or enterExpense depending on the selection. Depen...
1. In order for a student to pass CSC-117 class, the student must earn 70 or higher on the Midterm and the Final and must do ll homework assignments, otherwise the student will fail the class. Tra...
public class Circle { protected double radius; public Circle(double radius) { if (radius < 0) { throw new IllegalArgumentException("A circle must have a non-negative radius"); } this.radius = radiu...
. WEB 230 JavaScript 1 1. Create an HTML file called as4_yourname.html. Include the following: A title in the head section: "WEB230- JavaScript |" . An h1 element: " Assignment 4"...
. Write the method printPattern, which takes a String and the number of rows of the triangle, and it prints the String organized in a right-angled triangle shape with the specified rows. As seen in ...
. D Question 7 Given the following method definitions: public static int myMethod (String s) { System. out . print (s) ; return 5; } public static String myMethod (int x) { System . out . print(x) ;...
. Anso D Question 4 Suppose you have declared a variable as int myAge = 70; Mark all of the following that will cause a compiler error if the method isValidAge has the following header public static...
Note: I need the program with output and send the source file (.java file) and the compiled file (.class file) and please address all the 3 questions. Problem Define classes: Bank, BankAccount and ...
public static int[] generateRanNums(int num) { int[] anArray = new int [num]; //1. Using Random class, generate in a for-loop 20K numbers in the range of 1 to 5000 ...
. Review this sample Java-like pseudo code. What is the argument in this example? int functionA (int x) { display "in functionA" return x + 100 void main () { int y = functionA (10) displa...
Which of the following is not something that can be done with an array? (Assuming myArray is a defined array with several elements) Group of answer choices myArray.length +=1; Arrays.sort(myArray);...
When an array is passed as a parameter to a method, __________________. Group of answer choices the array must be returned by the method - if this is skipped, an exception will be thrown the array ...
make a class named BankCustomer . A bank customer should include four pieces of information as customer_id (type String), customer_id (type String), saving_accounts (type SavingAccount[], an array of ...
Problem 1 Make a class named Employee . An employee should include five pieces of information as instance variables: name (type String), id (type String), salary (type double), vacation_days (type int...
make a class named SavingAccount . A saving account should include five pieces of information as instance variables: customer_name (type String), customer_id (type String), account_id (type String), b...
how do i figure the answers. E Ensign Homepage X <> Quiz: 7.3 Quiz (30 min.) X + X C D ensign.instructure.com/courses/14050/quizzes/186694/take R 94 0O ... LDS FAFSA Student Loan ck Credit Karma...
BRIEFLY DESCRIBE THE CODE: Scenario A power company is building a power grid in the town of Flåklypa. All houses which is in need of electricity has to be connected to the power grid, and a plan must...
I greatly appreciate your assistance 1.Take a look at these openings, which may be posted at your workplace or elsewhere.Where did you locate the positions?How does the pay on salary.com compare to th...
1. In order for a student to pass CSC-117 class, the student must earn 70 or higher on the Midterm and the Final and must do all homework assignments, otherwise the student will fail the class. Tr...
Pls read before answer! Create a Java program called SortShirtSizesYourLastName. Your program should read each line of the shirt size file available here: (bbmediadmaccedu/CIS/CIS171/shirtsizes.txt)...
Compose a Java program for a simple bank account. You shall define a BankAccount class. A BankAccount has a account number and a balance. For each bank account, a 10 digit unique account number ...
Hello I need help with my RandomRectangles class. I have to fill in the SMALLEST Rectangle with the color yellow , but I am not sure what I did wrong with my code because it does not fill in the small...
1. In the Walmart class, declare two instance variables, namely, total and count for calculating the total price and counting the number of items respectively. Then, create a no-argument construc...
You will create two Java classes for this choice. The classes must include your last name. The name of the class for part a is YourLastNameEvent.java and the name of the class part b is YourLastNameEv...
You will create two Java classes for this choice. The classes must include your last name. The name of the class for part a is YourLastNameEvent.java and the name of the class part b is YourLastNameEv...
In today's world computers are in everything and almost everyone walks around with a miniature computer on their person at all times. Your smart phone is over 100,000 times more powerful than the c...
. Write a recursive method to reverse the contents of a file, line by line. Before attempting this assignment, you may want to review the charAt and substring methods of the String class. If you use...
. 1. Factorials The factorial of n (written n!) is the product of the integers between 1 and n. Thus 4! = 1*2*3*4 = 24. By definition, 0! = 1. Factorial is not defined for negative numbers. 1. Write...
Java program for a simple bank account. You shall define a BankAccount class. A BankAccount has a account number and a balance. For each bank account, a 10 digit unique account number must be crea...
Write a recursive method to reverse the contents of a file, line by line. Before attempting this assignment, you may want to review the charAt and substring methods of the String class. If you use the...
Infix to Postfix. A program that converts a standard infix expression (that will be assumed to be fully parenthesized ) into a postfix one (which doesn't need or have any parentheses) using a b...
QUESTION 9 Which answers below will properly reassign the value of firstName from Bob to Robert. let person = { firstName : "Bob", lastName : "Hope", age : 80 } A. person."Bob"...
. 35. Given the following code, answer all three questions below. (Hint: There are bugs in the lines highlighted with red.) public static void main (String args) { String startString = "Text to...
package Lab5; /** * This class implements a game like 'among us' * */ public class Game { /** * This is the default constructors. * At most 10 player can play this game. * At most there...
trying to get this javascript function to work. it just takes two numbers and finds the greatest divisor and returns that number to consolelog function greatestDivisor(n1, n2) { if (n2 === 0)...
I am trying to get a javascript function to work. It should just take two numbers and return the sum of them to the consolelog function sumNum(n1, n2) { var sum = 0; for (let i = n1; i ...
The assignment is based on the code below and Im stuck on modifying it to create the right output. I also need help to validate the constructors and setters and override with toString.. Person.java...
In this assignment, use the code for DoublyLinkedList we have developed in class (you can also write your own implementation which behaves in the same way). The task is to add two new methods to ...
import java.util.Arrays; public class ABArrayList <E>{ // Data fields /** The default initial capacity */ private static final int INITIAL_CAPACITY = 10; /** The un...
Hi, this is a project where we are supposed make a choose-your-own path story. I was wondering if this code can be shortened in any way. For example, I use (console.next()).equalsIgnoreCase("yes") rep...
. TCSS142 Introduction to Object-Oriented Programming Programming Project 2 This project requires an understanding of most concepts leamed prior to chapter 4 with the addition of both sequential and...
Java Worksheet. String Commands 1. Please create a method that will flip any given string and return that string. (arrays not allowed) For example: shreya will become ayerhs, pooja will become ajoop. ...
Learning Objectives: • understand when to use the different print statements • create a variable and assign it a value • use Scanner to read in user input • print the value of a variable u...
Konstantina recently upgraded the operating system on her laptop and ever since, she's noticed something bizarre — the backspace key on her keyboard has stopped working! Before, if she was typing in...
. sumProduct sumProduct(int list1, int list2) -- Given arrays list1 and list2, return 0 if the have different lengths, or the summation of the products of each element of list1 with its correspondin...
. sameDifferences sameDifferences(int myArray, int difference) -- Given array myArray, return true if either myArray has 1 element or the difference between each element and its previous one always ...
Javaaaaaaaaaaaaa. Question 6 6 Points List lists = new List[2]; Choose ALL of the choices below that will compile AND run without throwing any exceptions. A lists [1] = new ArrayList(); B lists [0] = ...
I need help with the AdvancedCensorship class please! I provided the starter code to the AdvancedCensorhip class, please add the new methods that I listed and fix the other methods (if needed) by the ...
. removeDuplicate method must be in a class which would be the parent from a class that you make an object. Ex: during our lecture we have the test class which was the class with the main method....
The vending machine sells three types of food: 1) Potato chips $1.25; 2) Cookies $0.85; 3) Candies $0.95. The program will prompt for the buyer to enter the amount in quarters (25 cents), dimes (10 ce...
Explain each line of code import threading import sys import os import struct import socket import getopt def usage( script_name ): print( 'Argument(s) specified incorrectly.') pr...
Konstantina recently upgraded the operating system on her laptop and ever since, she's noticed something bizarre — the backspace key on her keyboard has stopped working! Before, if she was typing in...
JAVA 6.12 LAB: Max magnitude method MaxMagnitude with two integer input parameters that returns the largest magnitude value. Use the method in a program that takes two integer inputs, and outputs t...
Hi! I have a Java assignment that I have to write code from this following Also this week, I am learning about Arrays so we need to use Array in this assignment. There are 2 file - DemoSalesperson.j...
How can I fix my cheapest() method 9in the StockList class) so that it will pass all the tests? I keep having the failed (red) test (look at the image below) StockList class code: import java....
You will develop an Android app that assists in designing floor plans. A floor plan is explained at https://en.wikipedia.org/wiki/Floor_plan . The app will contain fragments, so its design is arranged...
Your solution must not use methods other than main. They are not required for this assignment***** no get statements or anything very advanced . Scenario: A fitness instructor wants to find out the ...
/** * Inserts one array into another at the given position. Existing * elements are shifted to the right. For example, if * arr is [10, 20, 30, 40, 50, 60], pos is 1, and toInsert...
/** * Finds the longest common suffix among the strings * in an array. For example, if arr is * ["gladly", "badly", "boodly", "sadly"], the method * returns the string "dly". I...
When I first learned to program I would just do whatever it takes to just get the right output. I eventually learned you can come to the right output but that does not mean it was the right or the mos...
Complete the body of the method named slice in LinkedIntList that performs list slicing as supported in Python. Specifically, it accepts two integer parameters start and stop and returns a new LinkedI...
how would i code this shopping list?. E Ensign Homepage X Mail - Michael Moser - Outlo X (9.5 Lab: Shopping List, Part 2 X * Course Hero X *36361060 (1366x768) X + V X C D ensign.instructure.com/cours...
For this assignment, we are writing a choose-your-own-path story that takes user input to progress through the story. There are supposed to be 8 outcomes, shown by the purple ovals. in addition t...
. (The Person, Student, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person h...
Veuillez créer une classe et ses méthodes permettant de calculer le périmètre d'un cercle et l'aire de la surface délimitée par le cercle. Vous devez avoir 3 méthodes : 1 constructeur recevant ...
Programmingassignment: -Implement initiative /naïvemethod to find amaxelement in an array. -Implement the methodthat usesthe Divide-and-Conquer approach to find themaxelement in an array. -Test both ...
How can I put this code by having 2 classes under one project?. (Find the smallest element) Write a method that finds the smallest element in an array of double values using the following header: p...
Write an Java program to read and simulate the execution of a program written in a rather simplified MINI BASIC programming language. Each line in the input contains only one statement. There are no d...
Write Swift code for the following. The numbers 1 to 10 have their multiples of 3. Store these multiples of 3 in an array and print the second cell, the fourth cell and the last cell to output (using ...
You are given a class named OlympicResult — the purpose of this class is to maintain the information pertaining to the performance of an individual country at the Olympic games. In particular, an ...
I got the 24 inches and 36 inches but I can't get the 102 inches. Help? My code is below: import java.util.Scanner; public class InchConversion { public static void main(String[] ar...
what would you like to do? 1) Enter a friend's name 2) Replace a friend's name 3) Display your friends list 4) Quit Your choice: 1 Enter a name: Murphy Sorry, your friends list is full! what would...
. Based on the code below which of the following comparisons will return FALSE: String m = "exam"; String = new String ("exam" ) ; String p = m; String t = S; p= =t s.compareTo(p...
Calculator is to be command line. Possible test cases: Input: 1+2 Output: 3 Input: 2+3+1 Output: 6 Input: 2-9 Output:-7 Input: 2.0 + 5 Output: 7.0 Input : 5^3 Output: 125 //Use .pow method...
. 3. (25 pts) For each of the following two problems, you are given the method: public static boolean isPrime (int i) which returns true if and only if i is prime. (a) Write a static method that tak...
CSC110AB Files Module Files Program - Countin...
. Implement a function that creates a sublist of a given list based on a start and end indexes. You may assume that all methods required for the homework are implemented correctly. (So you can use a...
Objective: In this assignment, you will be implementing a doubly linked list. You will write unit tests and use git locally on your machine to make at least 12 commits with meaningful commit messages....
. Assume that you have an existing DefinitionEntry class. A DefinitionEntry contains the definition and pronunciation of a string. The DefinitionEntry constructor takes as parameters the word, its d...
. Assume that you have an existing DefinitionEntry class. A DefinitionEntry contains the definition and pronunciation of a string. The DefinitionEntry constructor takes as parameters the word, it...
Algorithms and Coding (50 points) Please download the skeleton code provided for this homework assignment from iCollege. Side note: In order to solve the following problems systematically, it is advis...
. X1035: Find Second Index The following method takes in a list of strings and a string value . Implement the method so that it will return the index of the second occurrence of value in the list . ...
. X1031: Loop Idioms - Find First And Last Index The following method takes in a ist of integers and a value representing some number appearing in the List, perhaps multiple times. Using two for loo...
For each of the following, tell if the code will compile. If so, what will be be printed? If not, why will it not compile? Give a one sentence reasoning for EITHER outcome. (No reasoning gets max 1 po...
THE MY DATE CLASS) Design a class named MyDate. The class contains: The data fields year, month, and day that represent a date. month is 0-based, i.e., 0 is for January. A no-arg constructor that crea...
wrting a recursive method to reverse the contents of a file, line by line. Note - in practice you would probably use an iterative solution. This is just an exercise. You may use IntelliJ and a B...
. 1. Solve the following recurrence relations: a. T(n) = c+T( Vn > 1, where c 2 0 is a constant, and T(n) = 0(1) when n = 1. '0 = umaum I = (u)I pue '0 < uAu+ (I - u)I = (u)I q 2. In the lectu...
some can help me fixed these package week_6; import java.io.Writer; import java.util.Random; import java.util.Scanner; /** You work for a recycling company. You'd like to collect some...
Good day, I need assistance in figuring out a solution to two questions. Q1: When you want to display a quote character (") on a web page, you should normally use the &quot; character refer...
2. Describe and correct the syntax and/or logic errors in the following snippets of code. /* a. public static void main(String[] args) { for (i = 0; i < 100; i++) { System.out.prin...
1) a Java program to print the result of the following operations. Test Data: a. -5 + 8 * 11 b. (65+9) % 9 c. 20 + (-3-5) / 8 d. 5 + 15 / 3 * 2 - 8 % 3 Expected Output : 83 2 19 13 2) a Java program...
Please help with the following two methods: 1) Method name: public static void sort (int[] data) /** * <p> * This method sorts the elements in the data array * in desce...
how do i code this. E Ensign Homepage X Microsoft Office Home X Mail - Michael Moser X ( 9.6 Group Lab-getVa X G service location proto( X Course Hero X + V X CD ensign.instructure.com/courses/14050/a...
how do i code this. E Ensign Homepage X Microsoft Office Home X Mail - Michael Moser X (9.4 Lab: Shopping List X G service location proto( X Homework Help - Q& x + V X C D ensign.instructure.com/c...
how to code this. E Ensign Homepage X Microsoft Office Home X Mail - Michael Moser X <> 8.5 Group Lab-Passir X G service location proto( X Course Hero X + V X C D ensign.instructure.com/courses/...
could anyone help me on 4.3.8 Finding Palindromes (CodeHS)? . Palindromes.java 12 13 14 - 15 This method determines if a String is a palindrome, 16 * which means it is the same forwards and backward...
1. What do you see as the potential advantages of a circularly linked list? 2. Do you see any potential pitfalls with a circularly linked list? 3. The LinkedList class in section 17.5 (class pr...
Given an int variable k, an int array incompletes that has been declared and initialized , an int variable studentID that has been initialized , and an int variable numberOfIncompletes, write code tha...
Create a new Java class with a main() method that displays "Hello World!" followed by a new line with your name on it. The final printout should look like: Hello, World! by <your name here> Re...
Implement a java class named HashMapTest and use the main method to experiment by creating an instance of HashMap that can store String keys and Integer values. Try at least the following: a. Add a fe...
How to Implement a generic Set interface in java that provides the methods described below: a. void add(E element) - adds an element to the set. If the same element (according to equals(Object)) is...
Can someone can help me finish the TODO public class WARGame { protected Deck deck; protected Player player1; protected Player player2; public void setup() { // TODO implement // create the deck and p...
Can someone help me finish the TODO thanks !!!! public class Player { protected String name; protected LinkedStack<Card> discardStack; protected LinkedStack<Card> draw...
Design and implement Java program as follows: Implement converter class hierarchy as follows: Converter class which includes: Private attribute for input of data type double. Default constructo...
Suppose the following code executes given a Warehouse class following the specification from the assignment. What would be printed out? Warehouse w = new Warehouse(53, 32); w.receive(43, 95); System.o...
Regarding linked list issues in java 1. When do you think a linked list is preferable to an array/arraylist? 2. What do you see as the advantages to using a header node? 3. What do you see as the ...
Description: Interfaces are used to make a Class implement a behavior or set of behaviors. Recall the example from class in which the Gradable Interface was used to ensure that the calculateGrade() ...
Complete the body of the method named concatenate that appends all the elements from the supplied parameter other to the end of the list on which it is invoked. This method should not return any val...
Hope this information is enought.. public static void insertArray (int arr, int pos, int toInsert) { / / the given arr is 1 4 5 6 7 8 / / pos to start index 1 / / new arr given 2,3 // output would be:...
. MASON IT 106 UNIVERSITY Introduction to IT Problem Solving Using Computer Programming Programming Assignment 5/6 Scenario: A fitness instructor wants to find out the number of students who are ...
How can this code be improved? Discussion Week 1: short program that periodically compares the values of the two functions and illustrates the point at which the faster growing function overtakes t...
Please help me with the following methods and tests: 1) Method name: public static void reverseOrder (char[] symbols) ** * <p> * This method reverses 'in place' the elements in ...
HELP. I can't use advanced HTML concepts on my assignment like Advanced HTML DOM Document and Element objects, getELementById Method, inner HTML property, advanced HTML DOM Events and Event Objects, H...
Requirement needed. If the Translate button is pressed when no Key has been selected, an appropriate alert should display, informing the user that a Key must be selected before a translation can ...
Discuss the following topics on Recursion. Provide a code example, where necessary, to elaborate your thoughts. Discuss how recursive method invokes are handled in a call stack in Java Binary search...
Use only these: ArrayLists,Stacks,Queues,Sets You are given the tournament bracket (including any byes), as well as a list of the results of the games in the order in which they were played. Determi...
The programming company you work for has been asked to design and create software that determines an optimal packaging size for a box of Hard Bread. The overall program will be completed by other prog...
You are given the tournament bracket (including any byes), as well as a list of the results of the games in the order in which they were played. Determine who won last year's tournament. In the class ...
JAVA CSC221 Two words are called isomorphic if the letters in one word can be remapped to get the second word. Remapping a letter means replacing all occurrences of it with another letter. The orderin...
Flashcard Application - Leitner System Objectives: • To practice Public Interface, Encapsulation, Unit Test, and Class Implementation Flashcard Application In this homework, we will implemen...
Previous
1
Next