Single File Programming QuestionProblem StatementJamie is managing a school and is looking to find out the number of students in the class based on the sum of their scores and the average score.He wants to design a program that takes the average score and sum of scores as input and outputs the calculated number of students in the class using pointers.Input format :The first line of input consists of an integer value n, representing the sum of scores.The second line of input consists of a floating-point value f, representing the average score.Output format :The output displays the calculated number of students in the class.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1 ≤ n ≤ 1051.0 ≤ f ≤ 100.0Sample test cases :Input 1 :187575.45Output 1 :24Input 2 :20010.25Output 2 :19Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*
Question
Single File Programming QuestionProblem StatementJamie is managing a school and is looking to find out the number of students in the class based on the sum of their scores and the average score.He wants to design a program that takes the average score and sum of scores as input and outputs the calculated number of students in the class using pointers.Input format :The first line of input consists of an integer value n, representing the sum of scores.The second line of input consists of a floating-point value f, representing the average score.Output format :The output displays the calculated number of students in the class.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1 ≤ n ≤ 1051.0 ≤ f ≤ 100.0Sample test cases :Input 1 :187575.45Output 1 :24Input 2 :20010.25Output 2 :19Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*
Solution
To solve this problem, you need to write a program that takes two inputs: the sum of scores (an integer) and the average score (a floating-point number). The program should then calculate the number of students in the class. This can be done by dividing the sum of scores by the average score. Here
Similar Questions
Single File Programming QuestionProblem StatementJaneet is managing a school and wants to determine the number of boys and girls in a class based on the total number of students and the boys-to-girls ratio. Can you assist Janeet by creating a program using pointers?Note: The girls' count is calculated by (girls ratio * total students)/ total ratio.Input format :The first line of input consists of a single integer value n, representing the total number of students in the class.The second line of input contains two integer values, separated by a colon (" : ") representing the boys-to-girls ratio (boysRatio:girlsRatio).Output format :The first line of output displays "The number of girls in the class is: " followed by the calculated number of girls in the class.The second line of output displays "The number of boys in the class is: " followed by the calculated number of boys in the class.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:1 ≤ n ≤ 10000Sample test cases :Input 1 :5001:2Output 1 :The number of girls in the class is: 333The number of boys in the class is: 167Input 2 :7204:3Output 2 :The number of girls in the class is: 308The number of boys in the class is: 412Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*
Single File Programming QuestionProblem StatementAlice is tracking her academic performance. She scored 5 in a quiz (an integer), received a grade of 5.99 in a project (a float value), and was assigned a grade 'D' for her assignment (a character). Create a C program to print these values with appropriate data types in separate lines.Input format :No console input.Output format :The first line displays an integer representing the score of Alice's quiz.The second line displays a float value representing the grade of Alice's project.The third line displays a character representing the grade of Alice's assignment.Refer to the sample output for the formatting specifications.Sample test cases :Input 1 :Output 1 :55.990000D
Single File Programming QuestionProblem Statement:Thiru is working on a grading system for his class of students. He needs a program that takes input for student scores, inserts a new score at the beginning and end of the existing scores, and then displays the modified list of scores.Write a program to help Thiru achieve this.Input format :The first line of input is an integer, the value n, indicating the number of elements in the array.The second line of input consists of n space-separated integers, representing the elements of the array arr[i].The third line of input consists of two integers M and P, representing the value to be inserted at the beginning and ending of the array, separated by a space.Output format :The output is a single line containing n + 2 space-separated integers, which represent the modified array after inserting the element at the beginning and ending of the existing scores.Refer to the sample output for the formatting specifications.Code constraints :In this scenario, the test cases will fall under the following constraints:1 ≤ n ≤ 101 ≤ arr[i] ≤ 1001 ≤ M, P ≤ 100Sample test cases :Input 1 :53 4 5 6 72 8Output 1 :2 3 4 5 6 7 8 Input 2 :14590 78Output 2 :90 45 78 Input 3 :1098 37 48 28 16 18 20 100 25 131 19Output 3 :1 98 37 48 28 16 18 20 100 2
Single File Programming QuestionProblem StatementSimba is the mayor of a town with three schools - School A, School B, and School C. He wants to determine the total number of students in the town based on the number of students in School B. Note:The number of students in School A is three times the number of students in School B.The number of students in School C is 120 more than the combined number of students in School A and School B.Create a program using pointers to help Simba that takes the number of students in School B as input and calculates the total number of students in each school and overall students in the town. Input format :The input consists of an integer value N, representing the number of students in school B.Output format :The first line of output prints "Total Students in School A: ", followed by the total number of students in School A.The second line prints "Total Students in School B: ", followed by the total number of students in School B.The third line prints "Total Students in School C: " followed by the total number of students in School C.The fourth line prints "Overall Student Count: " followed by the total number of students in all three schools.Refer to the sample output for formatting specifications.Code constraints :In this scenario, the test cases fall under the following constraints:20 ≤ N ≤ 250Sample test cases :Input 1 :128Output 1 :Total Students in School A: 384Total Students in School B: 128Total Students in School C: 632Overall Student Count: 1144Input 2 :235Output 2 :Total Students in School A: 705Total Students in School B: 235Total Students in School C: 1060Overall Student Count: 2000Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.Marks : 10Negative Marks : 0WhitelistSet 1:*
Single File Programming QuestionProblem StatementMithun is developing a program for a data collection tool that allows the user to input a series of positive integers until they enter a negative value. The program should dynamically allocate memory for an integer array to store these numbers using the new operator. The program should then calculate and display the sum and average of the entered integers. Write a program to accomplish this task.Note: This kind of question will help in clearing HCL recruitment.Input format :The input consists of positive integers separated by a space. It continues until a negative value is entered.Output format :The first line of the output displays the entered numbers.The second line displays the sum of the numbers.The third line displays the average of the entered numbers.Refer to the sample output for formatting specifications.Code constraints :numbers > 0Maximum number <=100Sample test cases :Input 1 :1 2 3 4 5 6 -1Output 1 :Numbers entered: 1 2 3 4 5 6 Sum of entered numbers: 21Average of entered numbers: 3.50Input 2 :10 20 30 40 50 60 70 80 90 100 -4Output 2 :Numbers entered: 10 20 30 40 50 60 70 80 90 100 Sum of entered numbers: 550Average of entered numbers: 55.00Note :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.