1answer.
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
seropon [69]
3 years ago
6

Create a program with a script that calls the following functions: getinput, calculateGPA, createBor, and printResults. The prog

ram is to ask the user how many semesters they have received grades in college. It will then will ask for each semesters GPA and number of units taken. Be sure to include an error check to ensure that all GPA's are between 0.00 and 4.00. 3. The script will then call the function, calculateGPA, to find the cumulative GPA for the user. Next, make a function, createBar, that creates a bar graph showing each GPA entered by semester. Please note that units do not need to be included/displayed. Finally, be sure to print the results to the screen in a user-friendly manneralhiv When printing the results, depending on the cumulative GPA, provide a comment based on how they are progressing through college. -3 your are averag How many semesters in Coege what was your semester 1 &PA, How many mids did yow tke tor semester 1 ?
Computers and Technology
1 answer:
Licemer1 [7]3 years ago
8 0

Answer:

The script is given below

Explanation:

%%driver

[grades , num_semester ] = getInput( ) ;

gpa = calculateGPA(grades , num_semester) ;

printResult( gpa) ;

createBar( num_semester , grades ) ;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [grades , no_semester] = getInput()

no_semester = input("How many semesters in college " );

for i = 1: no_semester

grades(i) = input( " Enter semester GPA ") ;

if( grades(i) > 4 && grades(i) < 0 )

disp( " Entered Grades are out Of Bounds ") ;

end

 

end

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function GPGA = calculateGPA(grades , no_semester )

sum = 0 ;

for i = 1 : no_semester

 

sum = sum + grades(i) ;

 

end

 

GPGA = sum/( no_semester);

 

 

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function bargraph = createBar( semester_num , grades )

 

bargraph = bar( grades, semester_num) ;

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function f = printResult( gpga )

 

fprintf( " Your GPGA is : %d \n " , gpga);

 

if( gpga >= 3 && gpga <=4 )

fprintf( " exception good work ") ;

 

end

if( gpga >= 2 && gpga <= 3)

fprintf( " You are average " ) ;

end

if( gpga >= 1 && gpga <= 2 )

fprintf( " you FAIL" ) ;

end

end

You might be interested in
Given four files named asiasales2009.txt, europesales2009.txt, africasales2009.txt, latinamericasales2009.txt, define four ofstr
Lynna [10]

Answer:

ofstream asia("asiasales2009.txt");  //It is used to open asiasales2009.txt files with the asia objects.

ofstream europe("europesales2009.txt");  //It is used to open  europesales2009.txt files with the europe objects.

ofstream africa("africasales2009.txt"); //It is used to open africasales2009.txt files with the africa objects.

ofstream latin("latinamericasales2009.txt");//It is used to open latinamericasales2009.txt files with the latin objects.

Explanation:

  • The above code is written in the c++ language which is used to open the specified files with the specified objects by the help of ofstream class as described in the question-statements.
  • The ofstream is used to open the file in the c++ programing language, so when a user wants to use the ofstream to open the file in written mode, then he needs to follow the below syntax--

              ofstream object("file_name_with_extension");

4 0
4 years ago
a conpany manufacturers computer screens that utilize less electricity. which form of technology would this be classified as​
statuscvo [17]

Answer:

CRT (cathode ray tube) monitors

These monitors employ CRT technology, which was used most commonly in the manufacturing of television screens. With these monitors, a stream of intense high energy electrons is used to form images on a fluorescent screen. A cathode ray tube is basically a vacuum tube containing an electron gun at one end and a fluorescent screen at another end.

While CRT monitors can still be found in some organizations, many offices have stopped using them largely because they are heavy, bulky, and costly to replace should they break. While they are still in use, it would be a good idea to phase these monitors out for cheaper, lighter, and more reliable monitors.

Explanation:

3 0
3 years ago
What type of engineering drawing use symbols to represent components drawings
seropon [69]

I would say Electrical engineer but I do not know for certain

5 0
3 years ago
How long after you install a new toilet until you can use it?
Marrrta [24]
You can use it immediately after installation.
3 0
4 years ago
Which language is written using 0s and 1S​
lozanna [386]

Answer:

binary

Explanation:

a computer speak because of how they are built

3 0
3 years ago
Other questions:
  • The number of output for a decoder if the input is 4
    14·1 answer
  • Which of the following is an object-oriented prototype-based language? Java Pike REBOL MATLAB
    9·1 answer
  • PROGRAM DESCRIPTION: In this assignment, you will write two complete C programs that will allow two players to play the game of
    12·1 answer
  • According to your text, three factors are responsible for the rapid rise in new product development. They are faster and more ec
    9·1 answer
  • Which button should be utilized if a user is unsure whether or not they are the right person to reply to an email?
    6·2 answers
  • How are gems and precious metals similar?
    6·2 answers
  • Instructions
    15·1 answer
  • Write aemail to brother for laptop for vitrual classes​
    7·2 answers
  • Write c++ program from 1to 100 to find prime numbers using statement.<br><br>please help me​
    15·1 answer
  • What electronic devices do you use more frequently? And how much time do you use them?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!