Question

In: Computer Science

Implement a program to jind out the percentage of the given marks to a student.

Implement a program to jind out the percentage of the given marks to a student.

Solutions

Expert Solution


//Percentage of marks secured by a student.
import java.util.*;
public class Main
{
        public static void main(String[] args) {
         Scanner sc= new Scanner(System.in);
         System.out.println("Enter the no of subjects :");
         int n= sc.nextInt();     //no of subjects
         int sum=0;
         System.out.println("Enter marks of "+n+" subjects.");
         for(int i=0;i<n;i++)
         {
             int m=sc.nextInt();  //taking input marks in each subject
             sum=sum+m;    //calculating total marks secured.
         }
         float total= n*100;   //Total marks for the exam.
         float percent= (sum*100)/total;
         System.out.println("Percentage secured is "+percent+"%");
        }
}


Related Solutions

1.A student takes out a college loan of $5000 at an annual percentage rate of 3%,...
1.A student takes out a college loan of $5000 at an annual percentage rate of 3%, compounded monthly. a. If the student makes payments of $1000 per month, how much, to the nearest dollar, does the student owe after 4 months? Don't round until the end. b. After how many months will the loan be paid off? 2. Suppose you start with one liter of vinegar and repeatedly remove 0.08 L, replace with water, mix, and repeat. a. Find a...
Implement if else loop to find out if the given number is positive or negative or...
Implement if else loop to find out if the given number is positive or negative or zero. You would be hardcoding the number in the below example I used 8. But you can use a different number.
Write pseudocode (3 Marks) and program structure (4 Marks) for the problem given below; In a...
Write pseudocode and program structure (4 Marks) for the problem given below; In a college, students are awarded a pass grade if their total mark is between 50-59, credit grade if the mark is between 60-69, distinction for marks between 70-79. High distinction if the mark is above or equal to 80 and fail if the mark is below 50.
The number of students in the MPH program by county is given below. If a student...
The number of students in the MPH program by county is given below. If a student is selected at random from this dataset, find the probability that: county # of students percentage escambia 106 21.2 walton 151 30.2 santa rosa 150 30 okaloosa 93 18.6 total 500 100 MPH program (Show your work) The student is from Escambia county The student is from Santa Rosa county The student is from either Escambia or Santa Rosa county The student is not...
Write a C++ program that outputs a histogram of student Marks for a Mid-term-1 Examination. The...
Write a C++ program that outputs a histogram of student Marks for a Mid-term-1 Examination. The program should input each student’s Marks as an integer and store the Marks in a dynamic array. Marks should be entered until the user enters -1 for marks. The program should then scan through the Dynamic array and compute the histogram. In computing the histogram, the minimum value of a marks is 0 but your program should determine the maximum value entered by the...
Given the following program with fill in the blanks, implement the PQ class which is priority...
Given the following program with fill in the blanks, implement the PQ class which is priority Queue MAX heap; the higher the number, the higher the prority of that number. None of the public methods has been implemented. You will need to write other methods to help implement some of the methods. For example you will need to implement bubbleUp to help with the insert method. Methods to implement: insert -> insert one element into the PQ and maintain heap...
Write a program in C++ to implement Binary Search Algorithm. Assume the data given in an...
Write a program in C++ to implement Binary Search Algorithm. Assume the data given in an array. Use number of data N at least more than 10. The function Binary Search should return the index of the search key V.
Problem 3 (4+2+2 marks). (a) Implement the following algorithm, which is given a duplicate-free array array...
Problem 3 (4+2+2 marks). (a) Implement the following algorithm, which is given a duplicate-free array array as input, in C++. whatDoIDo (array): 1) Build a heap from array (using buildHeap as explained in class), where the heap starts at position array[0]. 2) Starting from j = size of array - 1, as long as j>0: i. Swap the entries array[0] and array[j]. ii. Percolate down array[0], but only within the subarray array[0..j-1]. iii. Decrement j by 1. Provide three input/output...
Suppose you were given 1 million SEK to implement a cash transfer program in Kenya. What...
Suppose you were given 1 million SEK to implement a cash transfer program in Kenya. What are the major design features that you would have to decide on? How would you design the program? Why? What do you think would be the outcomes?
Java program to implement circular linked list. NO COPY PASTE ANSWERS plz follow the given template......
Java program to implement circular linked list. NO COPY PASTE ANSWERS plz follow the given template... public class CircularLinkedList { private Node tail; private int size; public CircularLinkedList() { tail= null; size = 0; } public int size(){ return size; } public boolean isEmpty() { return size==0; } //if list is not empty return the first element public E first() { if (isEmpty()) return null; //code here return 0; } //if list not empty return last element public E last()...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT