Menampilkan inputan Data Mahasiswa #c++ #array2D

#include<iostream>
#include<stdio.h>
#include<string.h>
#include <conio.h>

using namespace std;
long double input();
int main(){

			int a;
			cout<<"Masukan Jumlah Mahasiswa : ";
			a=input();
			char nama[50][25];
			long double nilai_tugas[50];
			long double nilai_uas[32];
			for(int b=0;b<a;b++){
  				cout<<"Masukan Nama Ke ["<<b+1<<"] \t: "; cin>>nama[b];
  				cout<<"Masukan Nilai Tugas "<<nama[b]<<" \t: ";nilai_tugas[b]=input();
  				cout<<"Masukan Nilai Tugas "<<nama[b]<<" \t: ";nilai_uas[b]=input();
  				cout<<endl;
  		}
		cout<<"Data Nilai \n";
		cout<<"NO.  NAMA \t\tNILAI TUGAS  \t\tNILAI UAS\n\n";
			for(int c=0;c<a;c++){
				 cout<<c+1<<"   "<<nama[c];
  					cout<<"\t\t"<<nilai_tugas[c];
  					cout<<"\t\t\t"<<nilai_uas[c]<<endl;
  				}

 getch();
 }
 	long double input(){
	 	long double ab;
		cin>>ab;
		return ab;
		}

ddp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s