Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

May I get some help please? Thank you Laboratory 7. Programming Methodologies La

ID: 3723928 • Letter: M

Question

May I get some help please? Thank you

Laboratory 7. Programming Methodologies Lab (14:332:254) March 5, 2018 Instructions The Internet and the web enable people to network, join a cause, and so on. The presidential candidates in 2012 used the Internet to get out their messages and raise money. In this exercise, you'll write a polling program that allows users to rate five social-consciousness issues from 1 to 10 (most important) Pick five causes (e.g., political issues, global environmental issues). Use a one dimensional string array topics to store the causes. To summarize the survey responses, use a 5-row, 10-column two-dimensional array responses (of type int), each row corresponding to an element in the topics array. When the program runs, it should ask the user to rate each issue. Generate random responses Then have the program display a summary of the results, including a) A tabular report with the five topics down the left side and the 10 ratings across the top, listing in each column the number of ratings received for cach topic b) To the right of each row, show the average of the ratings for that issue c) Which issue received the highest point total? Display both the issue and the point total d) Which issue received the lowest point total? Display both the issue and the point total Submission Please only submit your h and cpp files NOTE - You need to Upload your files and then Submit them. The TAs will have no access to your files if you forget to submit them. f8 f9 110 f11 /5 17 5 6 7 8 9

Explanation / Answer

JAVA PROGRAMME :

//INCLUDE HEADER FILES

import java.io.*;

import java.util.*;

//CLASS

public class pollingIMP

{

//MAIN METHOD

public static void main(String[] args)

{

//SCANNER TO READ INPUT FROM THE USER

    Scanner rateIn = new Scanner(System.in);

//STRING ARRAY TO HOLD 5 ISSUES

     String[] socialIssue={"Pollution","Tsunami","Equal Rights","Developments in medical field ","Food Shortage"};

//GENERATE RANDOM

    Random randNo = new Random();

    int poll = randNo.nextInt(5) + 5;

//ARRAY OF 5ROWS AND 10 COLUMNS

    int [][] POLLRATES= new int[5][10];

//GET RATING FROM THE USER FOR EACH ISSUE

    for (int k1 = 0; k1 < poll; k1++)

        {

        System.out.println("Person #" + k1+1);

        System.out.println("RATE THE FOLLOWING ISSUES FROM 1TO 10:");

        for (int k2 = 0; k2 < socialIssue.length; k2++)

            {

            System.out.println(socialIssue[k2]);

            POLLRATES[k2][k1] = rateIn.nextInt();

        }

    }

//CALCULATION PART

     int minPollRating = 10;

    int maxPollRating = 0;

    int minPollRatingIndex = 0;

    int maxPollRatingIndex = 0;

    for (int k1 = 0; k1 < socialIssue.length; k1++)

        {

        System.out.print(socialIssue[k1]+":");

        int totRating = 0;

        for (int k2 = 0; k2 < poll; k2++)

            {

            System.out.print(" "+POLLRATES[k1][k2]);

            totRating += POLLRATES[k2][k1];

        }

//DISPLAY THE AVERAGE OF EACH ISSUE

        double avgRate = ((double)totRating)/poll;

        System.out.println(" Average ofRating: "+avgRate);

        if (totRating < minPollRating )

            {

            minPollRating = totRating;

            minPollRatingIndex = k1;

        }

        if (totRating > maxPollRating ){

              maxPollRating = totRating;

            maxPollRatingIndex = k1;

        }

    }

//DISPLAY MAXIMUM RATED ISSUE

    System.out.println("Max points: "+socialIssue[maxPollRatingIndex]+": "+maxPollRating+" points");

//DISPLAY MINIMUM RATED ISSUE

    System.out.println("Min points: "+socialIssue[minPollRatingIndex]+": "+minPollRating+" points");

    System.out.println();

}//MAIN ENDS

}//CLASS ENDS

==> Langauge is not mentioned.so i create in java