Computer Science, asked by anjalikakade6, 4 months ago

4.
Write a program (in c/cpp or Java) to store and display Customer
Satisfaction Index for Auto Makers. It would do following
1. Ask user to enter "no of Automakers he wants to give ratings for"
2. It would accept and store names of AutoMakers(e.g. Tata,
Hyundai etc)
3. It would accept and store user ratings for the brands he entered in
step#1
4. Display menu

Answers

Answered by poojan
6

Language used : Java Programming

Program:

import java.util.Scanner;

public class Main

{

   public static void main(String args[])

   {

       String brands[] = new String[50];

       int ratings[] = new int[50];

       int noofbrands,i;

       Scanner sc = new Scanner(System.in);

 

 System.out.println("No of Automakers you want to give ratings: ");

 noofbrands=sc.nextInt();

 

 System.out.println("Enter the names of the brands whom you want to rate: ");

       

       for(i=0;i<noofbrands;i++)

       {

           brands[i]=sc.next();

       }

       

       System.out.println("Give ratings for the following Automakers (Out of 10): ");

       

       for(i=0;i<noofbrands;i++)

       {

           System.out.print(brands[i]+" : ");

           ratings[i]=sc.nextInt();

       }

       

       System.out.println("The menu of the ratings given by the user are: ");

       

       for(i=0;i<noofbrands;i++)

       {

           System.out.println(brands[i]+" : "+ratings[i]);

       }

   }

}

Input:

No of Automakers you want to give ratings:  

3

Enter the names of the brands whom you want to rate:  

Tata

Hyundai

Kia

Give ratings for the following Automakers (Out of 10):  

Tata : 9

Hyundai : 6

Kia : 5

Output:

The menu of the ratings given by the user are:  

Tata : 9

Hyundai : 6

Kia : 5

Learn more:

1. Write a program to check whether it is a Lead number or not in java​

brainly.in/question/15644815

2. Write a java program to input name and mobile numbers of all employees of any office. Using "Linear Search", search array of phone numbers for a given "mobile number" and print name of employee if found, otherwise print a suitable message.

brainly.in/question/18217872

Similar questions