Friday, September 2, 2022

STUDENT GRADING DATABASE SYSTEM IN C++

 Machine Problem

Create a Student Grading System using a text file which allows the  user to add student record, view student record, edit student record, find student record, remove or delete student record in the text file database.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support. 



Program Listing

// student.cpp

// Written By Mr. Jake R. Pomperada, BSCS, MAED-IT

// July 26, 2018  Thursday

// Bacolod City, Negros Occidental Philippines

// Website : http://www.jakerpomperada.com

// Email Address : jakerpomperada@jakerpomperada.com and jakerpomperada@aol.com


#include <iostream>

#include <iomanip>

#include <cmath>

#include <stdlib.h>

#include <string.h>

#include <conio.h>

#include <ctype.h>


using namespace std;

 

 

int main( )

{

FILE *fp, *ft ;

char another, choice ;

struct student

{

char stud_id_no[300];

char name[300];

char course[300];

char subject[300];

float prelim,midterm,endterm,final_grade;

} ;

struct student grade;

char student_id[300];

long int recsize;

    int flag=0;

fp = fopen ("GRADE_DB.DAT", "rb+" ) ;

if ( fp == NULL )

{

fp = fopen ( "GRADE_DB.DAT", "wb+" ) ;

if ( fp == NULL )

{

puts ( "Cannot open file" ) ;

exit(0) ;

}

}

recsize = sizeof ( grade ) ;

while ( 1 )

{

        system("CLS");

        system("COLOR F0"); 

setprecision(0);

        cout <<"\n";

cout << "\n\t==========================================";

cout <<"\n";

cout <<"\n\tSTUDENT GRADING DATABASE SYSTEM IN C++";

cout <<"\n\n";

cout << "\tCreated By Mr. Jake R. Pomperada,MAED-IT";

cout <<"\n\t==========================================";

cout <<"\n\n";

cout << "\t[1] INSERT STUDENT RECORD";

cout <<"\n";

cout << "\t[2] BROWSE STUDENT RECORD";

cout <<"\n";

cout << "\t[3] EDIT STUDENT RECORDS" ;

cout <<"\n";

cout  <<"\t[4] FIND STUDENT RECORDS";

cout <<"\n";

cout << "\t[5] REMOVE STUDENT RECORDS";

cout <<"\n";

cout  << "\t[6] QUIT PROGRAM" ;

cout <<"\n\n";

cout  <<"\tSELECT YOUR OPTION :=> ";

fflush (stdin) ;

choice = getche() ;

switch ( choice )

{

case '1' :

fseek ( fp, 0 , SEEK_END ) ;

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

cout <<"\n\n";

cout << "\t=== INSERT NEW STUDENT GRADE RECORD ===";

cout <<"\n\n";

cout <<"\tEnter Student ID Number : ";

                    cin >> grade.stud_id_no;

cout << "\tEnter Student Name: ";

fflush (stdin) ;

gets(grade.name);

cout <<"\tEnter Course : ";

fflush (stdin) ;

gets(grade.course);

                    cout <<"\tEnter Subject : ";

fflush (stdin) ;

gets(grade.subject);

cout <<"\tEnter Prelim Grade: ";

cin >> grade.prelim;

cout << "\tEnter Midtem Grade: ";

cin >> grade.midterm;

cout << "\tEnter Endterm Grade: ";

cin >> grade.endterm;

grade.final_grade = (grade.prelim * 0.30) + (grade.midterm * 0.30) + (grade.endterm * 0.40);

cout << "\n";

                    cout << "\n\tStudent Final Grade : "  << round(grade.final_grade);

fwrite (&grade, recsize, 1, fp ) ;

cout << "\n\n";

cout  << "\n\tAdd New Student Record (Y/N) : " ;

fflush (stdin) ;

another = toupper(getche()) ;

}

break ;

case '2' :

        system("cls");

rewind ( fp );

cout << "\n\n";

                cout <<"\t=== VIEW STUDENT GRADE RECORD ===";

                cout <<"\n\n";

while ( fread ( &grade, recsize, 1, fp ) == 1 )

        {

       cout <<"\n";

       cout <<"\n\t  ID Number        : " <<grade.stud_id_no;

       cout <<"\n\t  Name             : " <<grade.name;

       cout <<"\n\t  Course           : " <<grade.course;

       cout <<"\n\t  Subject          : " << grade.subject;

       cout <<"\n\t  Prelim Grade     : " <<grade.prelim;

       cout <<"\n\t  Midterm Grade    : " <<grade.midterm;

       cout <<"\n\t  Endterm Grade    : " <<grade.endterm;

       cout <<"\n";

       grade.final_grade = (grade.prelim * 0.30) + (grade.midterm * 0.30) + (grade.endterm * 0.40);

       cout <<"\n\t Student Final Grade : " <<round(grade.final_grade);

  }

          cout <<"\n\n";

         system("pause");

break ;

case '3' :

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

          cout <<"\t=== EDIT STUDENT GRADE RECORD ===";

        cout <<"\n\n";

          cout <<"\tEnter Student ID Number : ";

                cin >> student_id;

    rewind ( fp ) ;

cout <<"\n";

while ( fread ( &grade, recsize, 1, fp ) == 1 )

{

if ( strcmp ( grade.stud_id_no, student_id) == 0 )

{

cout <<"\tEnter Student ID Number : ";

                            fflush (stdin) ;

                            gets(grade.stud_id_no);

cout <<"\tEnter Student Name : ";

fflush ( stdin ) ;

gets(grade.name);

        cout <<"\tEnter Course: ";

fflush ( stdin ) ;

gets(grade.course);

cout <<"\tEnter Subject : ";

fflush ( stdin ) ;

gets(grade.subject);

cout <<"\tEnter Prelim Grade : ";

cin >> grade.prelim;

cout <<"\tEnter Midtem Grade : ";

cin >> grade.midterm;

cout <<"\tEnter Endterm Grade: ";

cin >> grade.endterm;

cout <<"\n";

grade.final_grade = (grade.prelim * 0.20) + (grade.midterm * 0.30) + (grade.endterm * 0.50);

cout <<"\n\tStudent Final Grade : " << round(grade.final_grade);

fseek ( fp, - recsize, SEEK_CUR ) ;

fwrite ( &grade, recsize, 1, fp ) ;

break ;

}

}

if (strcmp(grade.stud_id_no,student_id) != 0 )

                 {  

                   cout <<"\n\n";

                   cout <<"\tNo Student Record in the Database.";

                   cout <<"\n";

                   system("pause");

                   break;

                   }

                 cout <<"\n\n";

     cout  <<"\n\tEdit Another Student Record (Y/N) : ";

fflush ( stdin ) ;

another = toupper(getche());

}

break ;

      case '4' :

   rewind ( fp ) ;

   another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

        cout <<"\t=== Find Student Records ===";

        cout <<"\n\n";

     cout <<"\tEnter Student ID Number : ";

                 cin >>student_id;

cout <<"\n";

rewind ( fp ) ;

while ( fread ( &grade, recsize, 1, fp ) == 1 )

{

if ( strcmp (grade.stud_id_no,student_id) == 0 )

{

                    cout <<"\n";

cout <<"\n\tID Number      : " <<grade.stud_id_no;

cout <<"\n\tName           : " << grade.name;

cout <<"\n\tCourse         :  " <<grade.course;

            cout <<"\n\tSubject        : " <<grade.subject;

                    cout <<"\n\tPrelim Grade   :  " <<grade.prelim;

                   cout <<"\n\tMidterm Grade  :  " <<grade.midterm;

                   cout <<"\n\tEndterm Grade  : " << grade.endterm;

                   cout <<"\n";

       grade.final_grade = (grade.prelim * 0.30) + (grade.midterm * 0.30) + (grade.endterm * 0.40);

       cout <<"\n\tStudent Final Grade : " << round(grade.final_grade);

       cout <<"\n\n";

       system("pause");

       break;

}

}

      if (strcmp(grade.stud_id_no,student_id) != 0 )

          {

            cout <<"\n\n";

            cout <<"\tNo Student Record found in the Database.";

            cout <<"\n";

            system("pause");

            break;

           }

                    cout  <<"\n\n";

cout  <<"\n\tFind Another Student Record (Y/N) : " ;

fflush ( stdin ) ;

another = toupper(getche());

}

break ;

case '5' :

another = 'Y' ;

while ( another == 'Y' )

{

system("cls");

                    cout <<"\t=== REMOVE STUDENT GRADE RECORD ===";

                    cout <<"\n\n";

cout <<"\tEnter Student ID Number : ";

                    cin >> student_id;

cout <<"\n";

ft = fopen ( "TEMP.DAT", "wb" ) ;

rewind ( fp ) ;

while ( fread ( &grade, recsize, 1, fp ) == 1 )

{

if ( strcmp (grade.stud_id_no, student_id) != 0 )

fwrite ( &grade, recsize, 1, ft ) ;

                 else

                flag=1;

                  }

fclose ( fp ) ;

fclose ( ft ) ;

remove ( "GRADE_DB.DAT" ) ;

rename ( "TEMP.DAT", "GRADE_DB.DAT" ) ;

    fp = fopen ( "GRADE_DB.DAT", "rb+" ) ;

       if(flag==1) {

         cout <<"\n\n";

         cout <<"\tRecord Successfully Deleted From the Database.";

         cout <<"\n";

         system("pause");

         }

else if (flag!=1) {

             cout <<"\n\n";

             cout <<"\tRecord Not Found in the Database.";

             cout <<"\n";

            system("pause");

             }

                    cout <<"\n\n";

cout << "\tRemove Another Student Record (Y/N) : " ;

fflush (stdin) ;

another = toupper(getche());

}

break ;

case '6' :

fclose ( fp ) ;

cout <<"\n\n";

cout <<"\tEND OF PROGRAM";

cout <<"\n\n";

cout << "\tThank You Very Much For Using This Software.";

cout <<"\n\n";

system("PAUSE");

exit(0);

}

}

} // End of Code

Thursday, September 1, 2022

Kilometers To Miles in C#

Kilometers To Miles in C#

 A simple program to ask the user to give distance in kilometers and then convert into miles equivalent using C# programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada


Thank you very much for your support. 





Program Listing

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("\n");
            Console.Write("\tKilometers To Miles in C#\n\n");
            Console.Write("Enter Distance in Kilometers : ");
            double kilometers = Convert.ToDouble(Console.ReadLine());
            double miles = kilometers / 1.6;
            Console.Write("\n\n");
            Console.WriteLine(kilometers + " Kilometer(s) " + " the equivalent  in miles is " + miles + " Miles");
            Console.Write("\n");
            Console.Write("\tEnd of Program");
            Console.Write("\n");
            Console.ReadKey();
        }
    }
}




Wednesday, August 31, 2022

Kilometers To Miles Using a Function in C++

Kilometers To Miles Using a Function in C++

 A simple program to ask the user to give distance in kilometers and convert into miles equivalent using a function in C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support. 





Program Listing

#include <iostream>

float kilometers_miles(float kilometers)
{
float miles = kilometers / 1.6;
return(miles);
}

int main() {
float kilometers=0.00;
std::cout <<"\n\n";
std::cout << "\tKilometers To Miles Using a Function in C++\n\n";
std::cout << "\tEnter distance in kilometers : ";
std::cin >> kilometers;
std::cout <<"\n\n";
std::cout <<"\t" << kilometers_miles(kilometers) << " Miles";
std::cout <<"\n\n";
}



Tuesday, August 30, 2022

Celsius To Fahrenheit Using a Function in Python

Celsius To Fahrenheit Using a Function in Python

A simple program to take the temperature in Celsius and convert it into Fahrenheit using a function in Python programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support. 







Program Listing

# Define function to convert celsius to fahrenheit

def Celsius_Fahrenheit(C):
F = (C*1.8)+32
return F

print()
print("\tCelsius To Fahrenheit Using a Function in Python\n")

C = float(input("Give temperature in Celsius: "))

print()
print("Temperature in Celsius = {:.2f}".format(C))
print()
print("Temperature in Fahrenheit = {:.2f}".format(Celsius_Fahrenheit(C)))
print()
print("End of Program")

Fahrenheit To Celsius Using a Function in Python

Fahrenheit To Celsius Using a Function in Python

 A simple program to take the temperature in Fahrenheit and convert it into celsius using a function in Python programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.





Program Listing

# Define function to convert fahrenheit to celsius

def Fahrenheit_Celsius(F):
C = (5 / 9) * (F - 32)
return C

print()
print("\tFahrenheit To Celsius Using a Function in Python\n")

F = float(input("Give temperature in Fahrenheit: "))

print()
print("Temperature in Fahrenheit = {:.2f}".format(F))
print()
print("Temperature in Celsius = {:.2f}".format(Fahrenheit_Celsius(F)))
print()
print("End of Program")

Monday, August 29, 2022

US Dollar To Philippine Peso Using Function in C

US Dollar To Philippine Peso Using Function in C

 A simple program to convert US Dollars into Philippine Peso using a function in C programming language.

Currenlty I am accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.





Program Listing

#include <stdio.h>

#define usdollar 56.51

float us_dollar_peso(float amt)
{
return(usdollar * amt);
}

int main()
{
float us_amt = 20.12;
float display = 0.00;
display = us_dollar_peso(us_amt);
printf("\n\n");
printf("\tPHP %5.2f", display);
printf("\n\n");
}

Sunday, August 28, 2022

Addition of Three Numbers Using a Function in Python

Addition of Three Numbers Using Functions in Python

 A program I wrote in Python uses a function to compute the sum of three numbers and display the results on the screen.

Currenlty I am accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.







Program Listing

# Python program to add three numbers using function

def add_num(num1, num2, num3): #user-defind function
num = (num1 + num2 + num3) #calculate the sum of three numbers
return num #return value

# take inputs
num1 = 7
num2 = 12
num3 = 90

# function call
addition = add_num(num1, num2, num3)

# print addition of three values
print("The sum is ",addition)


Friday, August 26, 2022

Personal Information Using Swing in Java

Personal Information Using Swing in Java

 Machine Problem 

Create a Java JPanel/JOption program that will display your Personal Information and  Education Background.


I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.






Program Listing

package demo;


/*

 * H. Create a Java JPanel/JOption program that will display display your Personal Information and 

Education Background


 */


import javax.swing.JOptionPane;



public class Personal_Swing {


public static void main(String[] args) {

// TODO Auto-generated method stub

String student_name = 

         JOptionPane.showInputDialog( "What is your name? " );

      

      String home_address = 

         JOptionPane.showInputDialog( "What is your home address? " );

      

      String mobile_number = 

         JOptionPane.showInputDialog( "What is your mobile number? " );

            

      String email_address  = 

         JOptionPane.showInputDialog( "What is your email address? " );

      

            

      String course = 

         JOptionPane.showInputDialog( "What is your course you finished in college? " );

      

  String school  = 

         JOptionPane.showInputDialog( "What is your school? " );

            

  String  year_graduated  = 

         JOptionPane.showInputDialog( "What year you graduate in college? " );

 

  JOptionPane.showMessageDialog( null, "\n" + "PERSONAL INFORMATION" + "\n\n" 

    + "Student Name   : " + student_name.toUpperCase()  + "\n"

      + "Home Address      : " + home_address.toUpperCase()  + "\r\n"

      + "Mobile Number     : " + mobile_number  + "\r\n"

      + "Email Address     : " + email_address  + "\r\n\n" 

      + "EDUCATIONAL BACKGROUND" + "\r\n\n"

      + "Course Graduated  : " + course.toUpperCase()  + "\r\n"

      + "School Graduated  : " + school.toUpperCase()  + "\r\n"

      + "Year Graduate     : " + year_graduated + "\r\n"

      , "Student Alumni Record", JOptionPane.INFORMATION_MESSAGE );



}


}




Thursday, August 25, 2022

Addition of Four Numbers Using Pointers in C

Addition of Four Numbers Using Pointers in C

 A simple program to ask the user to give four numbers and then the program will compute the sum of the four numbers using pointers using C programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg

=================================================


Want to support my channel?

GCash Account

Jake Pomperada


09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada

Thank you very much for your support.





Program Listing

/*addition.c
 Author   : Jake Rodriguez Pomperada, MAED-IT, MIT
 Student, Northern Negros State College of Science and Technology
 Address  : Brgy. Old Sagay, Sagay City, Negros Occidental, Philippines
 Email    : jakerpomperada@gmail.com
 Tool     : Dev C++ Version 5.11
 Date     : November 26, 2018  Monday 9:15 AM 
*/
#include <stdio.h>
 
int main()
{
   int first=0, second=0,third=0,fourth=0; 
   int *a,*b,*c, *d;
   int sum=0;
   printf("\n\n");
   printf("\tAddition of Four Numbers Using Pointers in C");
   printf("\n\n");
   printf("\tGive Four Numbers : ");
   scanf("%d%d%d%d",&first,&second,&third,&fourth);
   a = &first;
   b = &second;
   c = &third;
   d = &fourth;
  sum = *a + *b + *c + *d;
  printf("\n\n");
  printf("\t===== DISPLAY RESULTS =====");
  printf("\n\n");
  printf("\tThe total sum of %d, %d, %d, and %d is %d."
          ,first,second,third,fourth,sum);
  printf("\n\n");
  printf("\tEND OF PROGRAM");
  printf("\n\n");
 }