Create a student GPA average calculator. The program should prompt the user to enter up to 30 GPAs, which are stored in a single-dimension array. Each time he or she enters a GPA, the user should have the option to calculate the current GPA average or enter another GPA. Sample data for this program is shown below. GPA: 3.5 GPA: 2.8 GPA: 3.0 GPA: 2.5 GPA: 4.0 GPA: 3.7 GPA Average: 3.25 Hint: Be careful to not calculate empty array elements into your student GPA average.
Optional Information: OS: Windows Vista Already Tried: Must be in C programming not C++
Hi,Do You need your program to be done in c or C++ OR what programming language do you prefer?help_desk39853.345746875
Following is the Code you need //code starts here #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<string.h> int index=-1,k=0; void main() { char inp[256]=" "; double gpa[30]; double totalgpa,avegpa; clrscr(); printf("***** Welcome To GPA Calculator ***** \n"); while(inp[0]!='q') { printf("%s%d%s","Enter The Next GPA Value(",index+1,") or Enter q to stop \n" ); gets(inp); if(inp[0]=='q'|| index==29) { break; } gpa[++index]=atof(inp); } printf("calculating Average GPA...\n" ) ; for( k=0;k<index+1;k++) { totalgpa+=gpa[k]; } avegpa=totalgpa/(index+1); printf("%s%f%s%f","Total GPA Is ",totalgpa," Average GPA Is ",avegpa); getch(); } //code ends here
GOOD JOB. THANK YOU
INTERESTED IN ANOTHER?
Build a C program (not C++) that uses a single-dimension array to store 10 numbers input by a user. After inputting the numbers, the user should see a menu with two options to sort and print the 10 numbers in ascending or descending order.
hi, I Can,t Do It because Another Expert is Already Involved With that Question Hirash Riyal39854.1491868866
Hi,Here is your code******************************************************************************************#include<stdio.h>#include<conio.h>#include<string.h>#include<stdlib.h>int main(){unsigned int arr[10],i,j,index;char input;clrscr();printf("\n\tEnter The Values into ARRAY :- ");for(i=0;i<=9;i++){printf("\n\nEnter Element no %u: ",i);scanf("%u",&arr);}for (i = 1; i <10; ++i) { index = arr; for (j = i; j > 0 && arr[j-1] > index; j--) arr[j] = arr[j-1]; arr[j] = index; }printf("\n\n--press 1 if you want the Series sorted in ascending or 2 if you want the Series sorted in descending order--");scanf("%c",&input) ;switch(input){ case '1': printf("Series in ascending order is:-") ; for(i=0;i<=9;i++) printf("\n\n\t S%u",arr); break; case '2': printf("Series in descending order is:-"); for(j=9;j>=0;j--) printf("\n\n\t S%u",arr[j]); break;}return 1; } help_desk39854.4913950231
Experience: Years of experience on C,C++, java,visual basic
I sent payment for this answer. I am new to this site so I want to make sure I did this correctly. I hit accept, and I sent the payment. It now has changed from accept to add bonus. DID YOU GET PAYMENT FOR THIS SECOND CODE? If not, please let me know and I will do my best to correct it immediately. Thank you for your assistance.
Hi,I have received your payment.At justanswer we experts get 50% of what you pay.So i would be more than happy to get some bonus.Bye
Mr. Riyal,
Do you have any experience with visual basic. If you do, I am prepared to pay more for a couple of projects using Microsoft VIsual Basic 2008 Express Edition.
Hi,It would be better if you could post the questions here first.it won't cost you.
DId that last reply cost me?
The question was:
hi,Ofcourse not.You can post your questions here as a continuation.latter you can open it as a new question and pay the expert who works on your code.