answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Law Incorporation [45]
2 years ago
4

Write a C++ Program that contains one user defined function cal_grades().  In main() function: o Prompt user to enter obtained(

0 - 100) marks for one subject. o Call cal_grades(marks_subject). o Print the corresponding Grade with respect to Marks.  In user defined function: o Perform conditioning with else if statement return char value. o Function must return value.
Computers and Technology
1 answer:
k0ka [10]2 years ago
8 0

Answer:

# include <iostream>

#include<conio.h>

using namespace std;

char grade(int marks);

main()

{

int subject 1, subject 2, subject 3, subject 4, subject 5, sum, percentage;

char G;

cout<<"enter marks of subject 1";

cin>>subject 1;

cout<<"enter marks of subject 2";

cin>>subject 2;

cout<<"enter marks of subject 3";

cin>>subject 3;

cout<<"enter marks of subject 4";

cin>>subject 4;

cout<<"enter marks of subject 5";

cin>>subject 5;

G = grade (subject 1);

cout<<"Grade of Subject 1"<< G;

G = grade (subject 2);

cout<<"Grade of Subject 2"<< G;

G = grade (subject 3);

cout<<"Grade of Subject 3"<< G;

G = grade (subject 4);

cout<<"Grade of Subject 4"<< G;

G = grade (subject 5);

cout<<"Grade of Subject 5"<< G;

sum = Subject 1 +Subject 2 +Subject 3 +Subject 4 + Subject 5;

Percentage =  sum/500*100;

G = grade (percentage);

cout<<"Overall Grade"<< G;

getch();

}

char grade(int marks)

{

int marks;

char 'A', 'B' , 'C' , 'D' , 'F';

if (marks >80)

{

return 'A';

}

else

if (marks >70 && marks< 80 )

{

return 'B';

}

else

if (marks >60 && marks< 70 )

{

return 'C';

}

else

if (marks >50 && marks< 60 )

{

return 'D';

}

else

return 'F';

}

<em>The program will compute the percentage of the marks obtained, then with the help of this percentage score the output will be determined by function named as Grade. </em>

<em />

You might be interested in
Sarah works in a coffee house where she is responsible for keying in customer orders. A customer orders snacks and coffee, but l
Maru [420]

Answer:

Stack

Explanation:

Stack is a linear data structure that follows a particular order in the way an operation is done or sequence a job is completed.

It uses either LIFO ( Last In, First Out) which is also known as first come first served sequence or FILO (First In, Last Out) sequence.

There are several real life examples of which we can use the example of replacing the snack items Sarah brought for the customer.

If Sarah used the LIFO method, it means she replaced the snack items first ontop of the already existing snack items that's why there is a mismatch.

5 0
2 years ago
Read 2 more answers
A company has deployed four 48-port access layer switches to a switch block. For redundancy each access layer switch will connec
NISA [10]

Answer:

The answer is "176".

Explanation:

In the given question there is a total of 192 switch ports, which are available for the 48-port switches. And for four access points, 8 trunk links that are 2 per access layer switch will be required. In every connexion of the trunk include two significantly modified-ports on the circuits throughout the access layer. With trunk connexions to both the communication network controller switches, a total of 17 switcher ports is required, allowing 176 access points for end system connectors.

3 0
2 years ago
Brandon purchased a new processor online as an upgrade. When he purchased the processor, he made sure that it used the same sock
Sergio039 [100]

D. You will not be able install the processor in the wrong motherboard.

<u>Explanation:</u>

Brandon before buying any microprocessor for upgrading in the mother board, Brandon has to take care of following things

1. Whether upgrade is possible, if possible where mother supports or not

2. Pick socket combination is correct or not.

3. After upgrading the microprocessor, Brandon has to check whether voltage and cooling fans fit in the same space in the mother board.

4. Whether existing ram type supports or not.

5. Sometimes once fixed removing upgrading microprocessor will damage the mother board.

Since Brandon has already concluded motherboard chipset compatibility is not been checked.

7 0
2 years ago
1. PLCs were originally designed as replacements for: a) microcomputers. c) analog controllers. b) relay control panels. d) digi
timama [110]

Answer:

PLCs (Programmable logic controller) were original designed as replacement for relay control panels.  Relay is another word for a switch. Relay control panels were made for the control of electronic instrumentents or devices. Later on PLCs were made to replace these timers and relay control panels. PLCs are more reliable, flexible and can work better in the harsh environmental situations then the relay control panels.

3 0
2 years ago
This question involves the creation of user names for an online system. A user name is created based on a user’s first and last
Evgen [1.6K]

Answer:

See explaination

Explanation:

import java.util.*;

class UserName{

ArrayList<String> possibleNames;

UserName(String firstName, String lastName){

if(this.isValidName(firstName) && this.isValidName(lastName)){

possibleNames = new ArrayList<String>();

for(int i=1;i<firstName.length()+1;i++){

possibleNames.add(lastName+firstName.substring(0,i));

}

}else{

System.out.println("firstName and lastName must contain letters only.");

}

}

public boolean isUsed(String name, String[] arr){

for(int i=0;i<arr.length;i++){

if(name.equals(arr[i]))

return true;

}

return false;

}

public void setAvailableUserNames(String[] usedNames){

String[] names = new String[this.possibleNames.size()];

names = this.possibleNames.toArray(names);

for(int i=0;i<usedNames.length;i++){

if(isUsed(usedNames[i],names)){

int index = this.possibleNames.indexOf(usedNames[i]);

this.possibleNames.remove(index);

names = new String[this.possibleNames.size()];

names = this.possibleNames.toArray(names);

}

}

}

public boolean isValidName(String str){

if(str.length()==0) return false;

for(int i=0;i<str.length();i++){

if(str.charAt(i)<'a'||str.charAt(i)>'z' && (str.charAt(i)<'A' || str.charAt(i)>'Z'))

return false;

}

return true;

}

public static void main(String[] args) {

UserName person1 = new UserName("john","smith");

System.out.println(person1.possibleNames);

String[] used = {"harta","hartm","harty"};

UserName person2 = new UserName("mary","hart");

System.out.println("possibleNames before removing: "+person2.possibleNames);

person2.setAvailableUserNames(used);

System.out.println("possibleNames after removing: "+person2.possibleNames);

}

}

8 0
2 years ago
Other questions:
  • Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
    6·2 answers
  • Which of these is an advantage of using the Clipboard task pane? A. You are able to apply OLE easily. B. There are more paste op
    15·2 answers
  • Which behavior could be acceptable at a classical concert as well as at a ball game? standing for an exceptional performance che
    9·2 answers
  • You complete your database, and the company begins using it. Shortly afterwards, two GearUp buyers, Cora and Owen, work together
    9·1 answer
  • What three requirements are defined by the protocols used in network communications to allow message transmission across a netwo
    11·1 answer
  • If Mark is developing a website to be optimized for mobile devices, what would be the top-level domain?
    10·1 answer
  • PC’s &amp; More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
    14·1 answer
  • Create a program that includes a function called toUpperCamelCase that takes a string (consisting of lowercase words and spaces)
    9·1 answer
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • You are trying to appreciate how important the principle of locality is in justifying the use of a cache memory, so you experime
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!