Friday, December 31, 2021

Input String in Python 2 in Linux

Input String in Python 2 in Linux

 A simple program in Python shows you have to accept string input from the user using Python 2.

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 in 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.






Program Listing

# input_string.py # Reverse a String in Python in Linux # Jake Rodriguez Pomperada, MAED-IT, MIT # www.jakerpomperada.com and www.jakerpomperada.blogspot.com # Globe Number : 09173084360 # Bacolod City, Negros Occidental Philippines. # Version of Python : Python 2.0 print("\n") print("\tInput String in Python 2 in Linux") print("\n") string_val = raw_input("\tGive Your Name : ") print("\n\n") print("\tHow are you {0}?".format(string_val)) print("\n") print("\tEnd of Program") print("\n")

Wednesday, December 29, 2021

Reverse a String in Python in Linux

Reverse a String in Python in Linux

 A program that will ask the user to give a string and then the program will display the original string and the reverse string using 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 in 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.







Program Listing

# reverse_string.py
# Reverse a String in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.
# Version of Python : Python 2.0

def  reverse_string(x):
  return x[::-1]

print("\n")
print("\tReverse a String in Python in Linux")
print("\n")

string_val = raw_input("\tGive a String : ")
# In Python 3 use input instead of raw_input

# Reverse a String here

reverse_str = reverse_string(string_val)
  
# printing of results
print("\n")
print("\tOriginal String : {0} " .format(string_val))
print("\n")
print("\tReverse String  : {0} " .format(reverse_str))

print("\n")
print("\tEnd of Program")
print("\n")


Product of Two Numbers in Python in Linux

Product of Two Numbers in Python in Linux

 A simple program that will ask the user to give two numbers, and then the program will compute the product of the two given numbers using Python programming language in Linux operating system. I am using Linux Mint as my linux distribution in writing this program and sublime as my text editor.

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 in 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.


 

Program Listing

# product.py
# Produc of Two Numbers in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.

print("\n")
print("\tProduct of Two Numbers in Python in Linux")
print("\n")
num1 = int(input("\tEnter First Number   : "))
num2 = int(input("\tEnter Second Number  : "))

# Multiply two numbers
product = (num1 * num2)

 
# printing values
print("\n")
print("\tThe Product of {0} and {1} is {2}." .format(num1,num2,product))

print("\n")
print("\tEnd of Program")
print("\n")

 

Tuesday, December 28, 2021

Leap Year in Python in Linux

 A program that I will ask the user to give a year and then the program will check if the given year is a leap year or not using 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 in 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.

 




 

Program Listing

# leap_year.py
# Leap Year in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.

print("\n")
print("\tLeap Year in Python in Linux")
print("\n")
year = int(input("\tEnter the Year : "))


# Checking if the given year if a Leap Year or Not

print("\n")

if (year%400 == 0):
          print("\tThe given year %d is a Leap Year." %year)
elif (year%100 == 0):
          print("\tThe given year %d is Not the Leap Year." %year)
elif (year%4 == 0):
          print("\tThe given year %d is a Leap Year." %year)
else:
          print("\tThe given year %d is Not the Leap Year." %year)

print("\n")
print("\tEnd of Program")
print("\n")
 



Monday, December 27, 2021

Addition and Subtraction of Two Numbers in Python in Linux

Addition and Subtraction of Two Numbers in Python in Linux

A simple program to ask the user to give two numbers and then the program will add and subtract the two given numbers by the user using 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 in 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.




 Program Listing

# add_sum.py
# Addition and Subtraction of Two Numbers in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.

print("\n")
print("\tAddition and Subtraction of Two Numbers in Python in Linux")
print("\n")
num1 = int(input("\tEnter First Number   : "))
num2 = int(input("\tEnter Second Number  : "))

# Adding two numbers
sum = (num1 + num2)

# Difference of two numbers
diff = (num1 - num2)
 
# printing values
print("\n")
print("\tSum of {0} and {1} is {2}" .format(num1, num2, sum))
print("\tDifference between {0} and {1} is {2}" .format(num1, num2, diff))

print("\n")
print("\tEnd of Program")
print("\n")


Sunday, December 26, 2021

Weekly Salary With Overtime in Java

Weekly Salary With Overtime in Java

  A simple program that I wrote in Python to solve the weekly wage of an employee in a company using 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 in 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.




Program Listing

import java.util.*;



 

public class WeeklySalary

{


//User Defined Method  to solve the weekly salary of the employee

public static double Solve_Weekly_Salary(double hours, double rate)  

{  


double wages;

if (hours > 40.0)

wages = 40.0 * rate +

1.5 * rate * (hours - 40.0);


else

wages = hours * rate;

return(wages);

}  


 

public static void main(String[] args)

{

Scanner console = new Scanner(System.in);

double solve_wages, rate, hours;

 

System.out.println("\n");

System.out.print("\tWeekly Salary With Overtime in Java");

System.out.println("\n");

System.out.print("Enter Hours Worked : ");

hours = console.nextDouble();

System.out.println();

 

System.out.print("Enter Phippine Peso(s) paid per hour : ");

rate = console.nextDouble();

System.out.println();

 

solve_wages = Solve_Weekly_Salary(hours,rate);

System.out.printf("Wages for %.2f hours at PHP %.2f per hour are PHP %.2f.",hours,rate,solve_wages);


System.out.println("\n");

System.out.println("End of Program");

System.out.println("\n");

console.close();

}

 

}




Weekly Wages in Python

Weekly Wages in Python

 A simple program that I wrote in Python to solve the weekly wage of an employee in a company using 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 in 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.




Program Listing

def WeeklyWagesSolve(totalHours, hourlyWage):

    # Return the total weekly wages for a worker working totalHours,
# with a given regular hourlyWage. Include overtime for hours over 40.

if totalHours <= 40:
totalWages = hourlyWage*totalHours
else:
overtime = totalHours - 40
totalWages = hourlyWage*40 + (1.5*hourlyWage)*overtime
return totalWages

def main():
print()
print("\tWeekly Wages in Python")
print()
hours = float(input('Enter hours worked: '))
wage = float(input('Enter Phippine Peso(s) paid per hour : '))

total = WeeklyWagesSolve(hours, wage)

print()
print('Wages for {hours} hours at PHP {wage:.2f} per hour are PHP {total:.2f}.'
.format(**locals()))
print("\nEnd of Program")

main()

Sum of Digits in Python

Sum of Digits in Python

 Machine Problem

Design a program that will ask the user to give a number and then the program will compute the sum of all the digits of the given
number using for loop statement.

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 in 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.





Program Listing

#
# Machine Problem
#
# Design a program that will ask the user to give a number and then
# the program will compute the sum of all the digits of the given
# number using for loop statement.

print()
print("\tSum of Digits in Python")
print()

num=int(input("Enter number : "))

sum=0

for digit in str(num):
sum=sum+int(digit)

print()
print("The Sum of Digits is %d." %(sum))
print("\n\tEnd of Program")

Sum of Digits Using While Loop Statement in C

Sum of Digits Using While Loop Statement in C

 Machine Problem

Design a program that will ask the user to give a number and then the program will compute the sum of all the digits of the given number using while loop statement.

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 in 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.





Program Listing


/* Problem No. 1


Design a program that will ask the user to give a number and then the program will compute the sum of all the digits of the given number using while loop statement.


Solution


sum_digits.c

 Author   : Jake Rodriguez Pomperada, MAED-IT, MIT

 Science Research Specialist II Technological University of the Philippines Visayas

 Address  : Capt. Sabi Street, Talisay City, Negros Occidental, Philippines

 Email    : jakerpomperada@gmail.com

 Tool     : Dev C++ Version 5.11

 Date     : December 25, 2021   9:46 PM Saturday

*/


#include <stdio.h>


int main()

{

    long int num=0, r=0, sum=0;

    printf("\n\n");

    printf("\tSum of Digits Using While Loop Statement in C");

printf("\n\n");

printf("\tGive a Number : ");

scanf("%d",&num);

    sum = 0;

    while (num !=0){

    r = num % 10;

    sum+=r;

    num/=10;

}

    printf("\n");

    printf("\tThe total sum of the digits is %d.",sum);

    printf("\n\n");

    printf("\t\t End of Program");

    printf("\n\n");

}


Friday, December 24, 2021

Square and Cube Root of the Number Using Functions in C++

Square and Cube Root of the Number Using Functions in C++

 I wrote this program to ask the user to give five numbers and then the program will compute the square and cube root value of the given five numbers using one-dimensional arrays using functions 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 in 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.




Program Listing

#include <iostream>

#include <iomanip>


using namespace std;


int square(int val[5])

{

    cout << "\n\n";

    cout << "Value" << setw(8) << "SQUARE"

    << setw(12) << "CUBE ROOT";

        cout << "\n";

  for (int v=0; v<5; v++){

      cout <<"\n" <<setw(2) << v[val]

          << setw(8) << v[val] * v[val]

         << setw(12) << v[val] * v[val] * v[val];

      }

}


main() {


int x[5];

   cout << "\tSquare and Cube Root of the Number Using Functions in C++";

   cout << "\n\n";

   for (int list=0; list <5; list++) {

       cout << "Enter a Number : " ;

       cin >> list[x];

       }

        square(x);

cout << "\n\n";

system("PAUSE");

}

Thursday, December 23, 2021

Addition and Division of Two Numbers in Java

Addition and Division of Two Numbers in Java

 A simple program that I wrote using Java programming language to ask the user to give two numbers and then the program will compute the sum and division of two numbers 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 in 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.





Program Listing

import java.util.Scanner;


public class Addition_Division {


public static void main(String[] args) {

   int val1=0,val2=0;

   

Scanner input_val= new Scanner(System.in);

  System.out.println("\n");

  System.out.println("\tAddition and Division of Two Numbers in Java");

  System.out.println("\n");

      System.out.print("\tEnter the first number  : ");

      val1=input_val.nextInt();

      System.out.print("\tEnter the second number : ");

      val2=input_val.nextInt();

      

        System.out.println("\n");

      System.out.println("\t" + val1 + " + " + val2 + " = " +  (val1 + val2));

      System.out.println("\t"+val1 + " / " + val2 + " = " +      (val1 / val2));

      System.out.println("\n");

  System.out.println("\tEnd of Program");

  System.out.println("\n");

  input_val.close();

}


}

Our Mother 80th Birthday

Wednesday, December 22, 2021

Add Record in the Database in Microsoft Visual FoxPro

Add Record in the Database in Microsoft Visual FoxPro

 A simple program that I wrote to add record in the database in Microsoft Visual FoxPro programming.

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 in 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.





Program Listing


Save Button


INSERT INTO product_info (product,quantity,price);

 values(UPPER(thisform.txtProduct.value),VAL(thisform.txtQuantity.value),VAL(thisform.txtPrice.value))

MESSAGEBOX("Record has been saved in the database.")

CLOSE DATABASES



Tuesday, December 21, 2021

Student Grade Solver in Visual FoxPro

Student Grade Solver in Visual FoxPro

 A simple student grade solver that I wrote using Microsoft Visual FoxPro.

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 in 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.





Program Listing

Compute Grade Button

prelim = val(thisform.txtPrelim.value) * 0.20 midterm = val(thisform.txtMidterm.value) * 0.30 endterm = val(thisform.txtEndTerm.value) * 0.50 final_grade = (prelim + midterm + endterm) thisform.TxtFinalGrade.Value = STR(final_grade,2)

Clear Grades Button

thisform.txtPrelim.value = "" thisform.txtMidterm.value = "" thisform.txtEndTerm.value = "" thisform.TxtFinalGrade.Value = "" thisform.txtPrelim.SetFocus

Quit Button

thisform.Release

String Concatenation in Modern C++

 A simple string concatenation in modern C++ programming language that I wrote I hope you find my work useful. 

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 in 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.



Program Listing


#include <iostream>


int main()

{

std::string address = "Bacolod City";

    std::string complete = address + " Negros Occidental ";

    

    std::cout <<"\n";

    std::cout <<"\tString Concatenation in Modern C++\n";

    std::cout <<"\n";

    std::cout <<"\t" << complete;

    std::cout <<"\n";

}