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...
5. Write a CH program that takes the marks of a student as input and prints...
5. Write a CH program that takes the marks of a student as input and prints the grade on screen according to the following criteria: CRITERIA LESS THAN 60 GREATER THAN 60 BUT LESS THAN 65 GREATER THAN 65 BUT LESS THAN 70 GREATER THAN 70 BUT LESS THAN 75 GREATER THAN 75 BUT LESS THAN 80 GREATER THAN 80 BUT LESS THAN 85 GREATER THAN 85 BUT LESS THAN 90 GREATER THAN 90 GRADE F D D+ с C+...
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...
3.1 Implement the stack ADT using array (4 marks) 3.1.1 Implement the pop() operation in the...
3.1 Implement the stack ADT using array 3.1.1 Implement the pop() operation in the stack (1 mark) Implement a stack class named Stack2540Array using array. The starter code is as follows. The instance variables and most operations are provided. You need to implement the pop operation. Make sure that your program checks whether the stack is empty in the pop operation. import java . io .*; import java . util .*; public class Stack2540Array { int CAPACITY = 128; int...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT