Question
hello i was given an assignment on object orientated programming and we were asked to use Microsoft word, Comments for significant parts should be coloured green. And can you recommend some videos too so i can understand it better with your help.

Name your file with your full name, e.g.. Jessica_Jones.docx or (arth). • Programs/codes must be properly indented and free o
depicting the relationship among the elements. [10 Sample Output: How many results do you have? Enter result 41: 90.5 Enter r
For this assignment use MS Word compatible word processor or save your file as Rich Text Format - other file formats will be

i have some questions about this assignment given and was told to create in Microsoft word



ITEC 1620 Assignment #3 Due: August 4, 10:00 PM, via Moodle upload - No late assignments accepted. For this assignment use MS
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
=================================

// Result.java

public class Result {

   private double arr[];

   public Result(double[] numbers) {
       this.arr = numbers;
   }

   public double findLowest() {
       double min=arr[0];
       for(int i=0;i<arr.length;i++)
       {
           if(min>arr[i])
           {
               min=arr[i];
           }
       }
       return min;
   }

   public double mean() {
       double min=findLowest();
       double sum=0,mean=0.0;
      
       int cnt=0;
       for(int i=0;i<arr.length;i++)
       {
           if(arr[i]!=min)
           {
               cnt++;
               sum+=arr[i];
           }
       }
      
       if(cnt!=arr.length-1)
       {
           mean=0.0;
           System.out.println("ERROR");
       }
       else
       {
           mean=sum/cnt;
           mean=Math.round(mean * 10)/10.0;
       }
      
      
       return mean;
   }


  
}

===========================================

// ResultAdjuster.java

import java.util.Scanner;

public class ResultAdjuster {
   public static void main(String[] args) {
       int size;
       /*
       * Creating an Scanner class object which is used to get the inputs
       * entered by the user
       */
       Scanner sc = new Scanner(System.in);

       // Getting the input entered by the user
       System.out.print("How many results do you have? ");
       size = sc.nextInt();

       double numbers[] = new double[size];
       for (int i = 0; i < size; i++) {
           System.out.print("Enter result #" + (i + 1) + ": ");
           numbers[i] = sc.nextDouble();
       }

       Result r=new Result(numbers);
       double avg=r.mean();
       System.out.println("The adjusted mean result is "+avg);
       System.out.println("The lower result was "+r.findLowest());
   }

}

======================================

Output:

How many results do you have? 4
Enter result #1: 90.5
Enter result #2: 80.5
Enter result #3: 70.0
Enter result #4: 60.5
The adjusted mean result is 80.3
The lower result was 60.5


=====================Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
hello i was given an assignment on object orientated programming and we were asked to use...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need an OUTLINE ONLY (pseudocode/comments). DO NOT DO THE PROGRAMMING ASSIGNMENT. Part I: PA3 Outline...

    I need an OUTLINE ONLY (pseudocode/comments). DO NOT DO THE PROGRAMMING ASSIGNMENT. Part I: PA3 Outline (10 points). Create an outline in comments/psuedocode for the programming assignment below. Place your comments in the appropriate files: main.cpp, functions.h, dealer.cpp, dealer.h, dealer.cpp (as noted below). Place into a file folder named LastnamePA3, the zip the content and hand in a zip file to Canvas. Part II: PA3: Car Dealership (40 points) For Programming Assignment 3 you will be creating a program to...

  • Python 3.7 Coding assignment This Program should first tell users that this is a word analysis...

    Python 3.7 Coding assignment This Program should first tell users that this is a word analysis software. For any user-given text file, the program will read, analyze, and write each word with the line numbers where the word is found in an output file. A word may appear in multiple lines. A word shows more than once at a line, the line number will be only recorded one time. Ask a user to enter the name of a text file....

  • C Programming // use stdio.h, stdlib.h, string.h and math.h only. Write a program that prompts the...

    C Programming // use stdio.h, stdlib.h, string.h and math.h only. Write a program that prompts the user to enter a word that has 3 letters. Store this as a character array (i.e. strings in C). Create a new character array that stores the reverse of the word and display on the screen. Sample output is as follows: Enter a word with 3 letters> bee Word entered: bee Reverse word: eeb

  • The purpose of this assignment is to get experience with an array, do while loop and...

    The purpose of this assignment is to get experience with an array, do while loop and read and write file operations. Your goal is to create a program that reads the exam.txt file with 10 scores. After that, the user can select from a 4 choice menu that handles the user’s choices as described in the details below. The program should display the menu until the user selects the menu option quit. The project requirements: It is an important part...

  • COSC 1437 C++ Project Assignment 2 Poll Summary Utilize a dynamic array of structure to summarize...

    COSC 1437 C++ Project Assignment 2 Poll Summary Utilize a dynamic array of structure to summarize votes for a local election Specification: Write a program that keeps track the votes that each candidate received in a local election. The program should output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. To solve this problem, you will use one dynamic...

  • Java Programming assignment. 1. Create a class called Square that takes a width parameter in the...

    Java Programming assignment. 1. Create a class called Square that takes a width parameter in the constructor. The Square class should have a draw() method that will draw the square on the screen. Create a class called TestSquare that will take width from the user, create an object of Square, and invoke the draw() method on the square object. Below is a UML diagram for the Square and Rectangle class: 3. Create a zip file that contains your Java programs....

  • CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes...

    CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes the user and displays the purpose of the program. It then prompts the user to enter the name of an input file (such as scores.txt). Assume the file contains the scores of the final exams; each score is preceded by a 5 characters student id. Create the input file: copy and paste the following data into a new text file named scores.txt DH232 89...

  • please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1....

    please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1. Write a program for the following. NOTE that some of these steps are not dependent on each other. Using methods is mandatory. Make sure to use methods where it makes sense. a. Ask the user for a series of integers entered from the keyboard. Use a sentinel value such as 999 to end the input process. If the entered values are not integers, throw...

  • Could anyone please help with this Python code assignment? In this programming assignment you are to...

    Could anyone please help with this Python code assignment? In this programming assignment you are to create a program called numstat.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The count of how many numbers are in the file. The average of the numbers. The average is the sum of the numbers divided by how many there are. The maximum value. The...

  • I'm falling behind on my hw and I can really use a hand with using structures...

    I'm falling behind on my hw and I can really use a hand with using structures in C,++ C++ Object Oriented Programming Programming Assignment #4 Structures Create a structure representing a student. The member variables should include student name, student ID, and four test grades for the student (an array of four grades as a member variable). Prompt the user to enter the name, ID and the four test results. Store all the data in the structure. Calculate the average...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT