Search results for 'q'
-
PRG/420 Week 4 Java 4.13 LAB: Word frequencies
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 4 Java 4.13 LAB: Word frequencies
Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words.
Ex: If the input is:
5 hey hi Mark hi mark
the output is:
hey 1
hi 2
Mark 1
hi 2
mark 1Hint: Use two arrays, one array for the strings and one array for the frequencies.
Learn More -
PRG/420 Week 4 Java 4.11 LAB: Output values below an amount
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 4 Java 4.11 LAB: Output values below an amount
Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, get the last value from the input, which indicates a threshold. Output all integers less than or equal to that last threshold value. Assume that the list will always contain fewer than 20 integers.
Ex: If the input is:
5 50 60 140 200 75 100
the output is:
50 60 75The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like Amazon, where a user can filter results.
Learn More -
PRG/420 Week 3 Java 3.17 LAB: Print string in reverse
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 3 Java 3.17 LAB: Print string in reverse
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters 'Quit', "quit, or 'q' for the line of text.
Ex: If the input is:
Learn More
Hello there
Hey
quit
the output is:
ereht olleH
yeH -
PRG/420 Week 3 Java 3.16 LAB: Output range with increment of 10
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 3 Java 3.16 LAB: Output range with increment of 10
Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer.
Ex: If the input is:
-15 30
the output is:
-15 -5 5 15 25Ex: If the second integer is less than the first as in:
Learn More
20 5
the output is:
Second integer can't be less than the first.
For coding simplicity, output a space after every integer, including the last. -
PRG/420 Week 3 Java 3.11 LAB: Mad Lib - Loops
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 3 Java 3.11 LAB: Mad Lib - Loops
Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways.
Write a program that takes a string and integer as input, and outputs a sentence using those items as below. The program repeats until the input string is quit 0.
Ex: If the input is:
apples 5
shoes 2
quit 0the output is:
Eating 5 apples a day keeps the doctor away.
Eating 2 shoes a day keeps the doctor away.Note: This is a lab from a previous chapter that now requires the use of a loop.
Learn More -
PRG/420 Week 2 Java 2.23 LAB: Leap Year
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 2 Java 2.23 LAB: Leap Year
A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are:
1) The year must be divisible by 4
2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400
Some example leap years are 1600, 1712, and 2016.Write a program that takes in a year and determines whether that year is a leap year.
Ex: If the input is:
1712
the output is:
1712 is a leap year.Ex: If the input is:
Learn More
1913
the output is:
1913 is not a leap year. -
PRG/420 Week 2 Java 2.22 LAB: Exact change
Regular Price: $7.00
Special Price $3.00
PRG/420 Week 2 Java 2.22 LAB: Exact change
Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.
Ex: If the input is:
0
the output is:
No changeEx: If the input is:
Learn More
45
the output is:
1 Quarter
2 Dimes -
CIS355A Week 3 Lab - Enhanced GUI Application using Additional Swing Components
Regular Price: $12.00
Special Price $10.00
CIS355A Week 3 Lab - Enhanced GUI Application using Additional Swing Components
OBJECTIVES
• Create a GUI that uses JCheckBox, JRadioButton, JTextArea, and menus.
• Process multiple events.PROBLEM: BurgersRUs Point of Sale system
Burger Barn needs a point of sale application. The products and prices are as follows.
Burgers: single $3.50, double $4.75
Add cheese: +$.50
Add bacon: +$1.25
Make it a meal: +$4.00FUNCTIONAL REQUIREMENTS
You can code the GUI by hand or use NetBeans GUI builder interface.
The GUI should use JRadioButton to choose single or double burger.
• Single burger
• Double burger
It should use JCheckBox for add ons.
• Add cheese
• Add bacon
• Make it a meal
JTextField for item price, order quantity, order total
JTextArea to display the receipt
Create a menu with the following options.
File Order
Exit Add to Order
Clear for next item
New OrderAs the user selects items, the item price should be calculated and updated accordingly.
Note that quantity should default to 1. The user can change if needed.
Once choices are made and quantity is entered, process the order using the menu options.
Order—Add to Order Displays the choice and price in each text area.
Note that multiple items can accumulate in a single order Updates the order total
Order—Clear for next item Clears the checkboxes. Note that quantity should default to 1
Order—New Order Clears the GUI and totals for a new order
File—Exit Exits the program. Use System.exit(0) commad.GRADING RUBRIC
Functional Requirements
All components on GUI created correctly
Item price updated properly with radio and checkbox selections
Items added to text area
Total price accumulates correctly
Clear for next item works correctly
Clear for new order works correctly
All prices displayed with two decimal places
File exit works correctly
Error messages for any invalid/missing user input using JOptionPane 40
Code style 5
Lab Report 10
TOTAL 55CODE STYLE REQUIREMENTS
Include meaningful comments throughout your code.
Use meaningful names for variables.
Code must be properly indented.
Include a comment header at beginning of each file, example below.
/****************************************************
Program Name: ProgramName.java
Programmer’s Name: Student Name
Program Description: Describe here what this program will do
***********************************************************/DELIVERABLES
Submit as a SINGLE zip folder
All java files
Lab reportFollow assignment specification regarding class/method names.
Learn More
Note that your java filename must match class name (DO NOT rename). -
CIS355A Week 2 Lab - Developing a GUI Application
Regular Price: $12.00
Special Price $10.00
CIS355A Week 2 Lab - Developing a GUI Application
OBJECTIVES
• Create a GUI that uses JTextField, JLabel, and JButton.
• Write event handlers to process user data.PROBLEM: Health Profile App
GymsRUs would like to replace their console program with an updated app using a graphical user interface. You will use the HealthProfile class that you created in the Week 1 Lab and build a GUI for it.FUNCTIONAL REQUIREMENTS
Make sure your HealthProfile class from the Week 1 Lab is in a named package, not default (i.e., package lab1).You must ADD the project that contains the HealthProfile class to this week’s project by
right click project, go to properties; and
click Libraries, Add Project, click OK.Then you will be able to reference your existing class as
import lab1.HealthProfile.Your project will have three classes:
• HealthProfile class from Week 1 Lab
• HealthProfileGUI class
• Lab2Main classYour HealthProfildGUI class should have the following components (see sample GUI below).
• JTextField objects to enter: name, age, height in feet, height in inches, weight in pounds
• JButton objects to display results, clear the GUI
• JTextField objects to display the BMI, category, and max heart rate
• JLabels to describe all textboxes
You are free to layout and design your GUI as you like as long as it includes these components.Add default and parameterized constructors to your HealthProfile class. The parameterized constructor should have five arguments: the name, age, weight, height in feet, and height in inches. Note it should convert the height to inches to store in the private instance variable.
Code event handlers for each button:
• Display: Make sure all user input is present and valid Use the HealthProfile class to process the data Display the results on the GUI
• Clear Clear all text boxes on the GUIGRADING RUBRIC
HealthProfile class
• Add default and parameterized constructors 10
HealthProfileGUI class
• All components on GUI
• Display button event handler coded properly
• Clear button event handler coded properly
• Error messages for any invalid/missing user input using JOptionPane 25
Lab2Main class
• Displays the GUI properly 5
Code style 5
Lab Report 10
TOTAL 55CODE STYLE REQUIREMENTS
• Include meaningful comments throughout your code
• Use meaningful names for variables
• Code must be properly indented
• Include a comment header at beginning of each file, example below
/****************************************************
Program Name: ProgramName.java
Programmer's Name: Student Name
Program Description: Describe here what this program will do
***********************************************************/DELIVERABLES
Submit as a SINGLE zip folder
• All java files
• Lab reportFollow assignment specification regarding class/method names.
Learn More
Note that your java file name must match class name (DO NOT rename). -
CIS355A Week 1 Lab - Developing an OOP Console Application
Regular Price: $10.00
Special Price $8.00
CIS355A Week 1 Lab - Developing an OOP Console Application
OBJECTIVES
• Create a class in java with appropriate methods.
• Process user input with the class using the scanner for keyboard input and console output.PROBLEM: Health Profile Console Program
GymsRUs has a need to provide fitness/health information to their clients, including BMI and maximum heart rate. Your task is to write a console program to do this.Body mass index (BMI) is a measure of body fat based on a person’s height and weight. BMI can be used to indicate if you are overweight, obese, underweight, or normal. The formula to calculate BMI is
The following BMI categories are based on this calculation.
Category BMI Range
Underweight less than 18.5
Normal between 18.5 and 24.9
Overweight between 25 and 29.9
Obese 30 or moreMax heart rate is calculated as 220 minus a person's age.
FUNCTIONAL REQUIREMENTS
Design and code a class called HealthProfile to store information about clients and their fitness data. The attributes (name, age, weight, and height) are private instance variables. The class must include the following methods.method Description
setName Receives a value to assign to private instance variable
setAge Receives a value to assign to private instance variable
setWeight Receives a value to assign to private instance variable
setHeight Receives TWO inputs (height in feet, inches). Converts and stores the total INCHES in private instance variable
getName Returns private instance variable
getAge Returns private instance variable
getWeight Returns private instance variable
getHeight Returns private instance variable (inches)
getBMI Calculates and returns BMI
getCategory Returns category based on BMI
getMaxHR Calculates and returns maximum heart rateCreate a SEPARATE TEST CLASS, Lab1Main, to prompt for user input and display output using the HealthProfile class. Process multiple inputs using a loop. You can assume all user input is valid.
SAMPLE OUTPUT
Enter name or X to quit: John Smith
Your age: 35
Your weight: 200
Your height - feet: 6
Your height - inches: 0Health Profile for John Smith
BMI: 27.1
BMI Category: overweight
Max heart rate: 185Enter name or X to quit: Ann Jones
Your age: 50
Your weight: 120
Your height - feet: 5
Your height - inches: 2Health Profile for Ann Jones
BMI: 21.9
BMI Category: normal
Max heart rate: 170Enter name or X to quit: X
GRADING RUBRIC
HealthProfile class
• All methods created with proper functionality 25
Lab1Main class
• Receives user input using Scanner
• Process input using a HealthProfile object
• Correct output displayed in console
• BMI displayed with 1 decimal place
• Loop to process multiple clients 10
Code style 5
Lab Report 5
TOTAL 45CODE STYLE REQUIREMENTS
• Include meaningful comments throughout your code.
• Use meaningful names for variables.
• Code must be properly indented.
• Include a comment header at beginning of each file, example below.
/****************************************************
Program Name: ProgramName.java
Programmer's Name: Student Name
Program Description: Describe here what this program will do
***********************************************************/DELIVERABLES
Submit as a SINGLE zip folder
• All java files
• Lab reportFollow assignment specification regarding class/method names.
Learn More
Note that your java filename must match class name (DO NOT rename).