Showing posts with label IT 111. Show all posts
Showing posts with label IT 111. Show all posts

Letter Grade Java Programming

We have study about the Letter Grade Java programming and here is the code below.It is switching java program. If you type the grade and the corresponding character given it will display the student remarks.

import java.util.*;
public class LetterGrade{

 public static void main (String [] args)

  String sname,remarks;
  char lettergrade;

  Scanner in=new Scanner(System.in){

  System.out.println("Enter Student's Name");
  sname=in.next();
  System.out.printl("Enter LetterGrade");
  lettergrade=int.charAt(0);

  switch (lettergrade){

  case 'a':
        remarks= "outstanding";
        break;
  case 'b':
        remarks = "v_s";
        break;
  case 'c':
        remarks = "s";
        break;
  case 'd':
        remarks = "ni";
        break;
  case 'e':
        remarks = "failed";
        break;


  default:
        remarks = "error_entry";
        break;

  }

  System.out.println("The Student"s Name is" + sname + is + "\n" + "lettergrade" + remarks);
 }
}
Continue Reading »

Writing Algorithm and a Flowchart - Java Programming

It deals with the Algorithm and a Flowchart, on how to create a Flowchart base on your Algorithm. A Flowchart is the second step in Java Programming which is the schematic diagram of your pogram. It using flowcharting symbol.

Here we go with the problem. The problem is, write an Algorithm and a Flowchart to input the amount of loan, interest rate and year. Compute and display the interest and total payable loan.

Algorithm:

1. Start the program
2. Input A_loan, I_rate, year
3. computer Interest, T_payableloan
Interest=A_loan*I_rate
T_payableloan=A_loan+I_rate
4. Print Interest, T_payableloan
5. End the program



What is the different between the Algorithm and a Flowchart? If you ask me, the only different is that the form. Algorithm is write in plain text while Flowchart written in text inside the symbol.

In a Flowchart, an oval stands for Terminal Symbol represents the beginning, the end, or a point of interruption or delay in a program. The Parallelogram stands for Input and Ouput Symbol which makes data available for processing (Input) or displaying (Output) of processed information. The arrow stands for the Flowline Symbol which represents the sequence of available information and executable operations, the arrowheads are mandatory only for right-to-left and bottom-to-top flow. The Rectangle stands for Process Symbol that represents the process of executing a defined operation or groups of operations that results in a change in value, form or location of information, also functions as the default symbol when no other symbol is available.
Continue Reading »

Java Programming on how to write an Algorithm

I have a problem here which is required an Algorithm. This problem will display and print the Total Deduction and the Net Salary. And the program is, write an Algorithm to input the basic salary, SSS payment, pag-ibig payment and philhealth payment. Compute the Total Deduction and the Net Salary.

Algorithm:

1. Start the program
2. Input B_salary, SSS_payment, P_payment, Phil_payment
3. Compute T_Deduction, N_salary
T_Deduction=SSS_payment+P_payment+Phil_payment
N_salary=B_salary-T_Deduction
4. Print T_Deduction, N_salary
5. End the program


Variable Definition:

B_salary - Basic Salary
SSS_payment - SSS Payment
P_payment - Pag-ibig Payment
Phil_payment- Philhealth Payment
T_Deduction - Total Deduction
N_salary - Net Salary

In making Algorithm, this is the beginning area of Java Programming. In this area you need to know on how define variable, because spaces in Java Programming is not allowed, only underscore (_) symbol can be consider as space. Take note, space in your variable surely an error. Make a unique baptism of your variable.

You can also visit my new blog, the Talk N Text and ABS-CBN Mobile blog. Hopefully you will enjoy surfing them.
Continue Reading »

Java Programming on how to compute Discount

In this Java Programming, I used String and float data type to calculate the Discount and Discounted Prize.

The problem is: Write a program to input the costumers name, price of item, and discount rate. Computer and display the discount and discounted prize.

Just see the variable that I used in the code. A very short and effective coding below will discount and discounted prize.

Source Code:
import java.util.*;

public class Discount
{

public static void main (String[]args)
{
String cname;
float I_price,drate,Drate,discount,dprice;

Scanner in= new Scanner (System.in);

System.out.println("Enter Costumers Name:");
cname =in.next();

System.out.println("Enter Price of Item:");
I_price =in.nextFloat();

System.out.println("Enter Discount Rate:");
drate= in.nextFloat();

discount=(I_price*drate/100);
dprice=(I_price-discount);

System.out.println("Costumer Name:"+cname+"\n"+"Discount Rate:"+discount+"\n"+"Discounted Price:"+dprice+"\n");

 }
}

For me, Float is appropriate data type to use in this programming, but you can also use double or int data type. Just only watch your variable carefully to avi od some errors.
Continue Reading »

Java Programming class Average using String and float data type - IT 111

Another, I have another solution to calculate the Average using String and float for the data type. Which is very simple, organize and short coding. all you have to do is that put another variable along with float data type to call the average to execute it formula. You formula will be separate to your System out print line code. 

The body coding are still the same only Double replace to Float. Just refer the code code below.

Source Code:
import java.util.*;
public class Average
{
 public static void main(String[]args)
 {

  String Sname;
  float prelim, midterm, prefinal, finals, Average;

Scanner in= new Scanner(System.in);
System.out.println("Enter student");
Sname = in.next();
System.out.println("Enter Prelim Grade");
prelim = in.nextFloat();
System.out.println("Enter Midterm Grade");
midterm = in.nextFloat();
System.out.println("Enter Prefinals Grade");
prefinal = in.nextFloat();
System.out.println("Enter Finals Grade");
finals = in.nextFloat();

Average=((prelim+midterm+prefinal+finals)/4);

System.out.println("Student Name:"+Sname+"\n"+"Average is:"+Average);
 }
}

Familiarazation and variable calling and definition is required. I hope it will help you.
Continue Reading »

Java Programming class Average using String and double data type - IT 111

Today, we study the Java Programming class Average. Class here means title of a program you are going to make. And the Average is now our title and take note, if what is the class, it will be your file name when you save your program to prevent errors. As I notice Java Programming is very sensitive in term of keys. So meaning if it is capital letters, see to it that you input in capital, same process also in small letters.

Here, I String and double for the data type. The code below will show you the Average of a student from Pre-lim, Mid-term, Pre-final and Final.

Source Code:
import java.util.*;
public class Average
{
 public static void main(String[]args)
 {

  String Sname;
  double prelim, midterm, prefinal, finals;

Scanner in= new Scanner(System.in);
System.out.println("Enter student");
Sname = in.next();
System.out.println("Enter Prelim Grade");
prelim = in.nextDouble();
System.out.println("Enter Midterm Grade");
midterm = in.nextDouble();
System.out.println("Enter Prefinals Grade");
prefinal = in.nextDouble();
System.out.println("Enter Finals Grade");
finals = in.nextDouble();

System.out.println("Student Name:"+Sname+"\n"+"Average is:"+(prelim + midterm + prefinal + finals)/4);
 }
}

What would you notice the code above? there is something different?

If you ask me, yes, there is something different, if you notice the double data type above which defining the variables, it is in small letter. But in the body of the program which you can input the numbers, you can see that first letter of double become capital. So where is the keys sensitive here?

May be it is in the software (textpad) structure of coding. See another code and formula on how to solve average. 
Continue Reading »

What is Program - IT III - Studying IT

Today, as our assignment we learn what is very good and exact definition of the Program.

- A Program is a sequence of instructions that specifies how to perform computation. 

Based on what we have discuss, creating a program was having a lot of analyzation. Make sure that the program you are going to do, will be determine or understandable by the user itself, or what we called user's friendly.

I also learned and knows the Some type of Computer programs. the are:

- System Programs - Programs that are needed to to keep all the hardware and software systems running together smoothly. The examples of this, like Linux, Windows, Unix, Slaris, MacOS.

- Application Programs - Programs that people use to get their work done. Examples, Word Processor, Game Programs, Spreadsheets.

- Compilers - The computer understands only one language: machine language. Machine language is in the form of ones and zeros. Since it is highly impractical for people to create programs out of zeros and ones, there must be a way of translating or converting a language which we understand into machine language, for this purpose, there exists compilers.

 That is what I have learned for today!
Continue Reading »

Programming 1 - IT 111 - Studying IT

In this we study about the java computer programs. But for the first time, our teacher told us that we need to practice typing first. With the average speed of 35 words per minute. And she gave us our first assignment.

Our first assignment are the definition of following computer language terms. Those are:

- What is Program?
- What is Programming?
- What is Programming Language?
- What are the types of Program?
- What are the category of Program?
- What are the example of Program?

It was a foreign words for me. So I need to research for the definition. 
Continue Reading »