Write a program that use nested loop to collect data

Assignment Help Programming Languages
Reference no: EM132374716

Assessment

Subject Learning Outcomes

a) Apply general programming concepts and good practices in programming

b) Construct, test and debug simple practical programs using the Java language

c) Apply exception handling techniques

d) Develop small applications using problem solving and critical thinking skills and programming knowledge

Assessment type: Develop Java applications based on the given scenarios: individual assignment.

Purpose: This assessment will allow students to demonstrate their understanding of Java programming language covering all the concepts covered throughout the trimester and implementation of those concepts to develop a small java application based on the given specifications. This assessment contributes to learning outcomes c and d.

Task Details: You are required to complete 5 practical exercises in Java that covers main topics in your outline. This is individual assignment. The cut-off submission date and time for practical assignment will be 11pm on Sunday of the week 10. All java files will be needed to be saved in a single folder named as Student ID and Name to be submitted as single .zip file on course Moodle page.

Description: This is practical assignment covering programming concepts taught from week 1 – 9. You should submit all your class file on Moodle with .java extension in a single Zip/rar folder.

Question 1: Java Fundamentals

Last month Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase:

o The number of shares that Joe purchased was 1,000.

o When Joe purchased the stock, he paid $32.87 per share.

o Joe paid his stockbroker a commission that amounted to 2% of the amount he paid for the stock.

Two weeks later Joe sold the stock. Here are the details of the sale:

o The number of shares that Joe sold was 1,000.

o He sold the stock for $33.92 per share.

o He paid his stockbroker another commission that amounted to 2% of the amount he received for the stock.

Write a program that displays the following information:

o The amount of money Joe paid for the stock.

o The amount of commission Joe paid his broker when he bought the stock.

o The amount that Joe sold the stock for.

o The amount of commission Joe paid his broker when he sold the stock.

o Display the amount of profit that Joe made after selling his stock and paying the two commissions to his broker. (If the amount of profit that your program displays is a negative number, then Joe lost money on the transaction.)

Question 2: Nested Loops

Write a program that use Nested Loop to collect data and calculate the average rainfall over a period of years. First the program should ask for the number of years. The outer loop will iterate once for each year.

The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations, the program should display the number of months, the total inches of rainfall, the average rainfall per month for the entire period.

Input Validation: Do not accept a number less than 1 for the number of years, do not accept negative numbers for the monthly rainfall.

Question 3: 2D Array

Write a program that lets the user enter four quarterly sales figures for six divisions of a company. The figures should be stored in a two-dimensional array. Once the figures are entered, the program should display the following data for each quarter:

o A list of the sales figures by division

o Each division’s increase or decrease from the previous quarter (this will not be displayed for the first quarter)

o The total sales for the quarter

o The company’s increase or decrease from the previous quarter (this will not be displayed for the first quarter)

o The average sales for all divisions that quarter

o The division with the highest sales for that quarter Input Validation: Do not accept negative numbers for sales figures.

Question 4: Strings

Write a program that has two parallel arrays of String objects. One of the arrays should hold people’s names and the other should hold their phone numbers.

Here are example contents of both arrays:

name Array Example Contents    phone Array Example Contents "Harrison, Rose"        "555-2234"

"James, Jean"    "555-9098"

"Smith, William"    "555-1785"

"Smith, Brad"    "555-9224"

The program should ask the user to enter a name or the first few characters of a name to search for in the array. The program should display all of the names that match the user’s input and their corresponding phone numbers. For example, if the user enters “Smith”, the program should display the following names and phone numbers from the list:

Smith, William: 555-1785

Smith, Brad: 555-9224

Reference no: EM132374716

Questions Cloud

Discussing about data preprocessing steps : Data Warehousing and Mining - represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customers bask
The benefit of the framework of information governance : Write a 1 page paper that explains your understanding of the benefit of the framework of information governance.
Assess the effectiveness of the company leadership : The LEGO group: adopting a strategic approach 1. Assess the effectiveness of the company's leadership.
Joint capabilities integration and development system : What is the primary objective of the joint capabilities integration and development system.
Write a program that use nested loop to collect data : ICT102 INTRODUCTION TO PROGRAMMING- Kings Own Institute-Australia-Write a program that use Nested Loop to collect data and calculate the average rainfall over.
Approving the capability document : What is the document that estabilishes policies and procedures for developing reviewing validation and approving the capability document
Cyber security in IT organizations : Cyber security in IT organizations
Review and present a selection of business practices : 1. Review and present a selection of business practices and/or approaches from your company that relate to the two principles of the Global Compact.
Apply path-goal theory to a work group you are currently in : Apply path-goal theory to a work group you are currently in. How well does the leader's style match the follower characteristics and task characteristics of you

Reviews

Write a Review

Programming Languages Questions & Answers

  Function to calculate recurrence using dynamic programming

Write down a function to calculate the following recurrence by using dynamic programming. PN = PN-1 + 2PN-2, with P1 = P0 = 1.

  Calculate quick ratio and current ratio

Advanced Databases MSc Information Systems with Computing - To Convert temperature from degree centigrade to Fahrenheit and Fahrenheit to degree centigrade

  Write a program that evaluates arithmetic expressions

CSE 231: Assignment on Stacks- Write a program that evaluates arithmetic expressions in infix notation that are not necessarily fully parenthesized. An arithmetic operation +, -, * or / has its usual precedence and associativity.

  Define console programming and gui programming

Define Console Programming and GUI Programming

  Develop a functional c program that implements a design

Develop a functional C program that implements a design and create a C program that declares and uses strings.

  Program that uses a recursive function to print a string

Your program must contain a recursive function that prints the string backwards. Do not use any global variables; use appropriate parameters.

  Discuss the features of object oriented programming language

Discuss the features of object oriented programming languages. A perfect square is a number that can be expressed as the product of two equal integers. Draw a flowchart, and write a corresponding class oriented program to check if any entered numbe..

  Add comment lines for the different sections.

Add comment lines for the different sections.

  Creating a security policy by gathering information

Suppose mantle of a security consultant. You are asked to visit a client and gather information to develop a security policy for them.

  Explaining valid advice for naming variables

Which of the following is valid advice for naming variables? To save typing, make most variable names one or two letters.

  Designing a solution for a programming problem

In your opinion, what are the three biggest challenges in planning and designing a solution for a programming problem

  Write function is pseudocode to calculate area of triangle

Write down the function is pseudocode called calculate area which calculates the area of a triangle. Algorithm for area computation is this: area=1/2*base*height.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd