Share
Explore BrainMass

Java

Understanding how to declare and use variables in computer science homework.

How do you figure out how to declare a variable? How do you know what type of variable to use? What is the best way to name a variable and why? What are the differences between an integer variable and a floating point variable? When and why do data type conversions occur? What is the modulus operator? Write a short java state

Java (Command Line) Competency Checks

Java (Command Line) Competency Checks 1. Write, compile and run a standalone Java application that displays an output line on the console. 2. Write a simple Java program that incorporates at least three best practices for making your code readable and understandable by yourself and others. 3. Write, compile and run a Ja

Java Code & Class File

Java code with comments and class file Details: You need to write a program that calculates sales tax and total sale amount. The user should be presented with a menu listing four different products. Based upon their choice, the user enters the quantitly that they desire. The program will then calculate the Subtotal, Sales

Java Code and Class File

Details: You need to write a program that calculates sales tax and total sale amount. The user should be presented with a menu listing four different products. Based upon their choice, the user enters the quantity that they desire. The program will then calculate the Subtotal, Sales Tax Amount, and Total Sale Amount. The calc

I need assistance on java compilers

I need assistance with the following. There are Java compilers and interpreters. Write 1 page on compilers and interpreters (2-3 paragraphs on each topic). You must include the following: - Discuss the advantages and disadvantages of compilers and interpreters. - When would you use each? - Pick a problematic situation t

Linked List

Criterion Score 1. Declare a LinkedList that stores Strings 2. Add code that formats a String with the calculation's results 3. Store the formatted String into the LinkedList 4. Display the elements in the LinkedList when the user ends input 5. Insure that the FutureValueApp class compiles 6. Include a text

CustomerType enum and CustomerTypeApp class using NetBean 7.2

USING NETBEAN 7.2 Criterion 1. CustomerType enumeration contains constants representing 3 customer types: retail, trade and college 2. CustomerType contains getDiscount method that returns the appropriate discount for each customer type: 10% for retail, 30% for trade and 20% for college 3. CustomerType enumeration contain

Java Programming: SchoolTextBook Class

Create a class titled SchoolTextBook that contains fields for the author, title, page count, ISBN, and price. This SchoolTextBook class will also provide setter and getter methods for all fields. Save this class in a file titled SchoolTextBook.java. Write an application with an array that holds 5 instances of the SchoolTextBo

Java Compilers and Interpreters

1. Discuss the advantages and disadvantages of compilers and interpreters. 2. When would you use each? 3. Pick a problematic situation that you think a Java program can solve or make easier. 4. Explain the problem and then write the pseudo code for it.

Write a Console Program with Java

Programming exercises are a key component of learning any programming language. For this course, there are four programming assignments that are arranged from the simplest case to more complex tasks as you progress through the course. The textbook comes with a CD-ROM that includes Java. Students may install and use this versi

Creating a sorting array

This is what I want to achieve. I have an array of positive integers which I wish to sort according to the sequence represented by the integer number line. The bubble sort operates as follows: 1. Find the two adjacent elements, X and Y, in the array such that X > Y and swap X and Y, then sort the resulting array.

Enhancing the Future Value

Using Netbean 7.2 create a program satisfying the following: - Constructor for the Invoice class requires subtotal and customer type only - Methods make discount percent, discount amount and invoice total available - Methods include accessors and mutators for both instance variables - Includes methods which format invoic

Modifying Java Code

Criterion EnhancedInvoiceApp.java compiles Type "R" with subtotal >= $250 and < %500 get 25% discount Type "R" with subtotal > $500 get 30% discount Type "C" always get 20% discount Added new Type "T" with subtotal < $500 get 40% discount Added new Type "T" with subtotal >= $500 get 50% discount Types other than "C

Application that stores at least four different course names

The application as written does not display certain class names included in the instructions as written. Write an application that stores at least four different course names and meeting days and times in a two-dimensional string array. Allow the user to enter a course name (such as CIS 110) and display the day of the week

Java Assistance and Writing Methods

I need assistance in processing this java assignment so that I can do the problem for my group assignment. I am having issues trying to understand the java statements. This is not the actual assignment that I will be handing in. The assignment I have to hand in as a group is Multiple Parameters but it is working with a fil

Java Writing Methods with No Parameters

The program asks the user if they have pre-registered for a conference. If the user has pre-registered, the program should call a method named discount () that displays the message "You are pre-registered and qualify for a 10% discount." If the user has not pre-registered, the program should call a method named noDiscount () t

Application that calculates amount of money earned investments

a. Write an application that calculates the amount of money earned on an investment, based on an 8% annual return. Prompt the user to enter an investment amount and the number of years for the investment. Display an error message if the user enters 0 for either value; otherwise, display the total amount (balance) for each year o

Basic Arrays: Computer Science - Java Assistance

Exercise 1 Array Basics 1.) Write array declarations for each of the following: a. Eight grade point averages a. Int gradePointAverage [] = new int [8]; b. Five first names a. String firstName [] = new String [5]; c. 21 ages a. Int ages [] = new int[21]; 2.) Declare and initialize arrays that store the foll

Java GUI and Code Help

Develop an application that counts the number of words, number of characters with spaces and without spaced. The program should display the text file statistics as follows: File Name: sample.txt Number of Words: 124 Number of characters without spaces: 1045 Number of ch

Completing partially done java scripts that use an array.

In this lab, you complete a partially prewritten Java Program that uses an array. The program prompts the user to interactively enter 10 salaries, which the program stores in an array. It should then find the minimum and maximum salaries stored in the array, as well as the average of the 10 salaries. The data file provided fo

jGrasp assistance/Java Using Loops

Problem 5.2 Using a Sentinel Value to control a while Loop On this exercise I need to write a while loop that uses a sentinel value to control a loop in a Java program. I also need to write the statements that make up the body of the loop. I have already entered the necessary variable declarations and output statements.

Display text on mouse click using plain HTML

I have a problem where I am supposed to make a 3x3 table with columns and rows numbered 1,2,3. Each table cell has to have identical width and height of 50 pixels and initially all cells are empty. That part I have done. However, clicking on table cell that is at the intersection of column number i and row number j should dis

Assistance with Java

First Problem I need help answering the following questions. I tried to do this in Java but I couldn't get it to execute. int numValue = 10; int answer = 0; switch(numValue) { case 5: answer += 5; case 10: answer += 10; case 15: answer += 15; break; case 20: answer += 20; case 25:

Java Program: Interactive Grading System Using Swing

Need assistance trying to figure out the Java Program that is attached. Need assistance with the java program below. 1. Declare two String variables named testScoreString and classRankString. 2. Declare two integer variables named testScore and classRank. 3. Write the interactive input statements to retrieve a student's te

Java Program - Calculate Federal, State Taxes and Income

Write Java Code needed to perform the following: - Calculate state withholding tax at 6.0% and calculate federal withholding tax at 25.0%. - Calculate dependent deductions at 2.0% of the employee's salary for each dependent. - Calculate total withholding. - Calculate take-home pay as salary minus total withholding plus deduc

Legal Java variable names and a Basic Program.

This program calculates profits and sales prices for a furniture company. -First calculate the profit, then calculate the sales price, then calculate the profit when the sale price used. -Profit is defined as the retail price minus the wholesale price. -The sales price 20% deducted from the retail price. -The sal

Declaring and initializing Java variables

Need help with declaring and initializing java variables. I am trying to compile and execute a program. I have downloaded the file and attached it. Sample: Calculate your age in the year 2060. 1. Declare an integer variable name newAge. 2. Declare and initialize an integer variable named currentAge. Initialize this vari

Rectangle class using Java

Create a Rectangle class with - Private attributes for width and height - A default constructor that sets the height to 10 and width to 25. - An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws

Java Creating a Class Called Date

Create a class called SimpleDate that includes three instance variables - a month, a day and a year (all type int). Provide a constructor that initializes the three instance variables and validates that those values are correct (follow calendar rules) and throws an exception for incorrect values. Provide a set and get method for