Tuesday, September 6, 2022

Kilometers To Miles Using ng-model in AngularJS

 Machine Problem

Write a program that uses ng-model directive that will accept distance in kilometers from the user and then the program will convert the given kilometer distance value into miles distance equivalent, and display the results on the screen.

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

index.htm

<!-- index.htm
  Author   : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
  Date     : July 26, 2021  Monday   3:00 PM
  Place    : Bacolod City, Negros Occidental
  Websites : www.jakerpomperada.com and www.jakerpomperada.blogspot.com
  Email    : jakerpomperada@gmail.com
 -->
<html>
<head>
  <title>Kilometers To Miles Using ng-model in AngularJS</title>
</head>
<style>
body {
  font-family: arial;
  font-size: 25px;
  font-weight: bold;
}
</style>
<script type="text/javascript" src="angular.min.js">
</script><br>
<div ng-app ng-init="kilometers=0">
  <form>
  <table border="0" cellspacing=10>
  <tr>Kilometers To Miles Using ng-model in AngularJS</tr>
  <tr>
  <td>Enter Kilometer(s) Value </td>
  <td><input type="number"  ng-model="kilometers" ></td>
  </tr>
</table>
  </form>
  <p>{{kilometers}} Kilometer(s) is equivalent to 
     {{(kilometers * 0.621371192) | number:2}} Mile(s).</p> 
</div>
</body>
</html>

Do You Want To Continue in Java

Do You Want To Continue in Java and Calculator

 A simple calculator with do you want to continue in Java 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


package demo;

import java.util.Scanner;



public class mdas {

public static void main(String[] args) {
    // create Scanner class object to  
      // read inputs
      Scanner scan = new Scanner(System.in);
  // Declare variables
      int num1=0, num2=0;
      char operator='\0';
 
      char choice= '\0';
   do {
      
 
       
      System.out.print("Enter the first Number      :  ");
      num1 = scan.nextInt();
      System.out.print("Enter the the Second number :  ");
            num2 = scan.nextInt();

      // read operator
      System.out.println("Available Operators"
+ "are::  (+ - * /)");
      System.out.print("Choose Oerator : ");
      operator = scan.next().charAt(0);

     
     if  (operator == '+') {

        System.out.println("The sum of  "+ num1 + " and " + num2 + " is " + (num1+num2)+".");
     } else if (operator == '-'){

   System.out.println("The difference between  "+ num1 + " and " + num2 + " is " + + (num1-num2)+".");
     }

     else if (operator == '*') {
    System.out.println("The product between  "+ num1 + " and " + num2 + " is " + + (num1*num2)+".");
     }

     else if (operator == '/') {
    System.out.println("The quotient betwenn  "+ num1 + " and " + num2 + " is " + + (num1/num2)+".");
}

else {
    System.out.println("Invalid operator");
      } // end of switch-case
   
     System.out.print("Do you want to perform another calculation? [y-yes/n-no] : ");
    
     choice = scan.next().charAt(0);
     
     if (choice == 'N'|| choice == 'n') {
   
    System.out.print("End of Program");
    break;
     }
     
   } while(choice == 'Y'|| choice == 'y');
         
scan.close();
      
}
    

}



Monday, September 5, 2022

Count Lowercase Characters in Python

Count Lowercase Characters in Python

 A simple program that I wrote using Python asks the user to give a string and then the program will count the number of lowercase characters.

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



print()
print("\tCount Lowercase Characters in Python\n")

string=input("\tGive a string : ")
count=0
for i in string:
if(i.islower()):
count=count+1
print();
print("\tThe number of lowercase characters is:" , count);
print()
print("\tEnd of Program")

Friday, September 2, 2022

Student Grading Database System in C++

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