Description
JAVA Homework 6
- Due Monday by 11:59pm
- Points 20
- Submitting a file upload
- File Types java
Do Business P6.29 on page 312 of your textbook
Unformatted Attachment Preview
32
.. Business P6.29 A pet shop wants to give a discount to its
clients if they buy one or more pets and
at least five other items. The discount is
equal to 20 percent of the cost of the other
items, but not the pets. .
Implement a method
public static void discount(double[] prices, boolean[] is Pet, int nItems)
The method receives information about a particular sale. For the ith item, prices[i] is
the price before any discount, and ispet[i] is true if the item is a pet.
Write a program that prompts a cashier to enter each price and then a Y for a pet or N
for another item. Use a price of -1 as a sentinel. Save the inputs in an array. Call the
method that you implemented, and display the discount.
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Here ...
Completion Status:
100%
Review
Review
Anonymous
Great! 10/10 would recommend using Studypool to help you study.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
UMD Risk Management and Business Continuity Planning from The Business Perspective
The concepts being discussed here relate to risk management and business continuity planning from the business perspective ...
UMD Risk Management and Business Continuity Planning from The Business Perspective
The concepts being discussed here relate to risk management and business continuity planning from the business perspective. In your ITSP Part 2 assignment you will discuss these topics from an IT perspective. Provide a response to one of the following:Referring to the ITSP, Part 2 assignment #4 and the GGFRT case study, you will identify some risks that the CIO needs to consider. For this discussion, we will focus on risks that the business should be concerned with. Apply what you know about the business environment and come up with and explain 3 risks related to the business environment (not IT-related risks). Explain what impact the risk has on the business, how likely it is to occur, and how it can be prevented or mitigated.
5 pages
Sql Injection Attacks
A non-technical description of SQL injection vulnerabilities intended for college management The SQL injection vulnerabili ...
Sql Injection Attacks
A non-technical description of SQL injection vulnerabilities intended for college management The SQL injection vulnerabilities are considered as one ...
Programming
Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that m ...
Programming
Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that measure number of steps and distance walked, heart rate, sleep quality, floors climbed, and calories burned. In this assignment, you will analyze data that was generated from a real Fitbit device. The data is stored in a comma-separated values (.csv) file that you will find in the attachment. A .csv file stores data as plaintext in tabular form. Each row in the file is considered a record. Each record consists of fields separated by commas. In particular, you will analyze 24 hours of data. Each record in the “FitbitData.csv” represents one minute of data and consists of seven fields. These include the following: 1.Minute 2.Calories 3.Distance (in miles) 4.Floors 5.Heartrate 6.Steps 7.Sleep level What data structures are required? In this assignment, you must define a C struct to store each of the Fitbit data fields as follows: typedef struct fitbit { char minute[9]; double calories; double distance; unsigned int floors; unsigned int heartRate; unsigned int steps; Sleep sleepLevel; } FitbitData; The type Sleep is enumerated and must be defined as follows: typedef enum sleep { NONE = 0, ASLEEP = 1, AWAKE = 2, REALLYAWAKE = 3 } Sleep; You must also define an array of FitbitData that can store 24 hours of minute data. Hence, you must declare an array of size 1440. You have the freedom to decide on other data structures and variables that you need for the assignment. What are the other requirements? This program does not require any user input! However, you will need to display some results to the screen! -You must open “FitbitData.csv” for mode read; check for success -You must read each record in the file as a string, one line at a time using fgets() -You must parse each record using strtok() from <string.h> into the corresponding fields, and store into the FitbitData array; note: not all fields have values, some are “empty” or null -You must compute the total calories burned, distance walked in miles, floors walked, and steps taken -You must compute average heartrate over the 24 hour period -You must report the max steps taken in one minute over the 24 hour period; if there are multiple minutes throughout the day where the max is discovered, then report the one that is the latest in the 24 hour period -You must report the longest consecutive range of poor sleep; a range is defined as one or more consecutive minutes where the sleepLevel > 1; the poorest sleep is not based on the length of the range, but the sum of the sleep levels in the range; the max sum of the ranges is considered the poorest sleep (report the starting and ending minutes of range) -You must open “Results.csv” for mode write; this will either create a new .csv or overwrite an existing one -You must output two lines to “Results.csv” and to the screen in the following format: oLine 1: Total Calories,Total Distance,Total Floors,Total Steps,Avg Heartrate,Max Steps,Sleep oLine 2: valueCalories,valueDistance,valueFloors,valueSteps,valueHeartrate,valueMax,valueSleepStart:valueSleepEnd -You must close “FitbitData.csv” and “Results.csv”
Grand Canyon University Behaviorism in Early Childhood Development Paper
In this course, you have been exposed to many early childhood theories and theoretical frameworks for explaining child dev ...
Grand Canyon University Behaviorism in Early Childhood Development Paper
In this course, you have been exposed to many early childhood theories and theoretical frameworks for explaining child development. This assignment will give you the opportunity to apply that knowledge within the context of a real‐world childhood trend or issue.Research a current trend or issue related to a child development theory. Some example issues include, but are not limited to:BehaviorismBehavior rewards/systems in the classroomMontessori approachMaslow’s hierarchy of needsErickson’s eight developmental stagesVygotsky sociocultural theoryReview current literature on the child development theory you selected and consider its effect on learning environments related to early childhood students.Assume the role of an early childhood teacher and write a letter of 500‐750 words to your school administrator.In the letter, take a position on the theory you selected. Your perspective should promote professional practice in early childhood education by advocating for or against the theory for early childhood students.Include the following in your letter:Description and analysis of the theory, and how it is related to early childhood educationYour position advocating for or against the selected child development theory promoting professional practice in early childhood educationEvidence‐based research that supports your positionHow your position upholds ethical standards, professional standards of practice, and/or relevant laws and policies in order to carry out this work within the public arena with compassion, justice and concern for the common good.Cite 4‐5 scholarly sources that support your research. No plagiarism
Access Chapter 2 Grader Project: Problem Solve 1 and Homework
Start Access. Open the downloaded Access file named a01ch02_grader_h1. Save the file with the name a01ch02_grader_h1_LastF ...
Access Chapter 2 Grader Project: Problem Solve 1 and Homework
Start Access. Open the downloaded Access file named a01ch02_grader_h1. Save the file with the name a01ch02_grader_h1_LastFirst, using your last and first name. If necessary, enable the content.
Similar Content
CS 530 Grossmont College XE Link Editor Requirements Project
The XE link-editor program shall open SIC/XE assembler listing files (refer to fig 2.3 in your text) and generate executab...
Keiser University Password Checker Java Program Project
Hi li need someone to write a java program that validates passwords the details about this program will be be...
How to Run Render Function in Python File Question
how to run render function in python file?...
ENTD261 Central Texas College Command Line Arguments Discussion
Hello,I need two responses of at least 150 words each for the below students discussions for this week. Also in the bold b...
Community College of Rhode Island USPS Weight of Letter Program Report
How's it going I have a project that was given to me yesterday. I live in the US an it is do tonight at midnight. I have ...
LP8.1 Assignment: Classes and Objects
For this assignment, you will complete exercise 2 on page 563 and exercise 8 and 12 on page 564. Create a MS Word file tha...
Yourname Itsd424 Ip1
UML models are important in every project since they give clear picture of the problem and the solution. Before developmen...
Homework 4
Convert the following Numbers into their equivalent in another Number systems as...
Process Analytics
The two companies, Rubio's Fresh Mexican grill, and Chase Pitkin home and garden are the supply chain organizations that a...
Related Tags
Book Guides
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
UMD Risk Management and Business Continuity Planning from The Business Perspective
The concepts being discussed here relate to risk management and business continuity planning from the business perspective ...
UMD Risk Management and Business Continuity Planning from The Business Perspective
The concepts being discussed here relate to risk management and business continuity planning from the business perspective. In your ITSP Part 2 assignment you will discuss these topics from an IT perspective. Provide a response to one of the following:Referring to the ITSP, Part 2 assignment #4 and the GGFRT case study, you will identify some risks that the CIO needs to consider. For this discussion, we will focus on risks that the business should be concerned with. Apply what you know about the business environment and come up with and explain 3 risks related to the business environment (not IT-related risks). Explain what impact the risk has on the business, how likely it is to occur, and how it can be prevented or mitigated.
5 pages
Sql Injection Attacks
A non-technical description of SQL injection vulnerabilities intended for college management The SQL injection vulnerabili ...
Sql Injection Attacks
A non-technical description of SQL injection vulnerabilities intended for college management The SQL injection vulnerabilities are considered as one ...
Programming
Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that m ...
Programming
Fitbit is a company that builds wearable technology devices that track various activities. The devices have sensors that measure number of steps and distance walked, heart rate, sleep quality, floors climbed, and calories burned. In this assignment, you will analyze data that was generated from a real Fitbit device. The data is stored in a comma-separated values (.csv) file that you will find in the attachment. A .csv file stores data as plaintext in tabular form. Each row in the file is considered a record. Each record consists of fields separated by commas. In particular, you will analyze 24 hours of data. Each record in the “FitbitData.csv” represents one minute of data and consists of seven fields. These include the following: 1.Minute 2.Calories 3.Distance (in miles) 4.Floors 5.Heartrate 6.Steps 7.Sleep level What data structures are required? In this assignment, you must define a C struct to store each of the Fitbit data fields as follows: typedef struct fitbit { char minute[9]; double calories; double distance; unsigned int floors; unsigned int heartRate; unsigned int steps; Sleep sleepLevel; } FitbitData; The type Sleep is enumerated and must be defined as follows: typedef enum sleep { NONE = 0, ASLEEP = 1, AWAKE = 2, REALLYAWAKE = 3 } Sleep; You must also define an array of FitbitData that can store 24 hours of minute data. Hence, you must declare an array of size 1440. You have the freedom to decide on other data structures and variables that you need for the assignment. What are the other requirements? This program does not require any user input! However, you will need to display some results to the screen! -You must open “FitbitData.csv” for mode read; check for success -You must read each record in the file as a string, one line at a time using fgets() -You must parse each record using strtok() from <string.h> into the corresponding fields, and store into the FitbitData array; note: not all fields have values, some are “empty” or null -You must compute the total calories burned, distance walked in miles, floors walked, and steps taken -You must compute average heartrate over the 24 hour period -You must report the max steps taken in one minute over the 24 hour period; if there are multiple minutes throughout the day where the max is discovered, then report the one that is the latest in the 24 hour period -You must report the longest consecutive range of poor sleep; a range is defined as one or more consecutive minutes where the sleepLevel > 1; the poorest sleep is not based on the length of the range, but the sum of the sleep levels in the range; the max sum of the ranges is considered the poorest sleep (report the starting and ending minutes of range) -You must open “Results.csv” for mode write; this will either create a new .csv or overwrite an existing one -You must output two lines to “Results.csv” and to the screen in the following format: oLine 1: Total Calories,Total Distance,Total Floors,Total Steps,Avg Heartrate,Max Steps,Sleep oLine 2: valueCalories,valueDistance,valueFloors,valueSteps,valueHeartrate,valueMax,valueSleepStart:valueSleepEnd -You must close “FitbitData.csv” and “Results.csv”
Grand Canyon University Behaviorism in Early Childhood Development Paper
In this course, you have been exposed to many early childhood theories and theoretical frameworks for explaining child dev ...
Grand Canyon University Behaviorism in Early Childhood Development Paper
In this course, you have been exposed to many early childhood theories and theoretical frameworks for explaining child development. This assignment will give you the opportunity to apply that knowledge within the context of a real‐world childhood trend or issue.Research a current trend or issue related to a child development theory. Some example issues include, but are not limited to:BehaviorismBehavior rewards/systems in the classroomMontessori approachMaslow’s hierarchy of needsErickson’s eight developmental stagesVygotsky sociocultural theoryReview current literature on the child development theory you selected and consider its effect on learning environments related to early childhood students.Assume the role of an early childhood teacher and write a letter of 500‐750 words to your school administrator.In the letter, take a position on the theory you selected. Your perspective should promote professional practice in early childhood education by advocating for or against the theory for early childhood students.Include the following in your letter:Description and analysis of the theory, and how it is related to early childhood educationYour position advocating for or against the selected child development theory promoting professional practice in early childhood educationEvidence‐based research that supports your positionHow your position upholds ethical standards, professional standards of practice, and/or relevant laws and policies in order to carry out this work within the public arena with compassion, justice and concern for the common good.Cite 4‐5 scholarly sources that support your research. No plagiarism
Access Chapter 2 Grader Project: Problem Solve 1 and Homework
Start Access. Open the downloaded Access file named a01ch02_grader_h1. Save the file with the name a01ch02_grader_h1_LastF ...
Access Chapter 2 Grader Project: Problem Solve 1 and Homework
Start Access. Open the downloaded Access file named a01ch02_grader_h1. Save the file with the name a01ch02_grader_h1_LastFirst, using your last and first name. If necessary, enable the content.
Earn money selling
your Study Documents