Preview

Creating Programs on Visual Basic

Good Essays
Open Document
Open Document
1323 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Creating Programs on Visual Basic
BASIC INPUT/OUTPUT: 1. Create programs and write the algorithms of the given problems:
Write a program that computes the product of two numbers:
ALGORITHM:
ENTER two numbers
Compute the product of P=N1*N2
PRINT P
PROGRAM:
Program Product;
Uses crt;
Var N1,N2:integer;
Product:integer;
Begin
Clrscr;
Writeln(enter two numbers);
Readln(N1,N2);
Product:=N1*N2;
Writeln(The product:product);
Readln;
End.

2. Create a program that computes the difference of two numbers
ALGORITHM:
ENTER TWO NUMBERS
Compute the difference
PRINT D
PROGRAM:
Program difference;
Uses crt;
Var N1,N2: integer;
Difference : integer;
Begin
Clrscr;
Writeln(enter the two numbers);
Readln(D);
D:=N1-N2;
Writeln(‘the difference:difference’)
Readln;
End.

3. Write a program that computes the sum of two
ALGORITHM:
ENTER TWO NUMBERS
Compute the difference
PRINT D
PROGRAM:
Program difference;
Uses crt;
Var N1,N2: integer;
Difference : integer;
Begin
Clrscr;
Writeln(enter the two numbers);
Readln(D);
D:=N1-N2;
Writeln(‘the difference:difference’)
Readln;
End. 1.

SHORT IF THEN ELSE:

2. Create a program that determines If the input age is qualified to vote or not. Qualifying age is 18, If not (else), print” too young!”
Algorithm:
ENTER A
If A>=18 THEN
PRINT ”Qualified to VOTE”
ELSE
PRINT “TOO YOUNG”
PROGRAM:
Program vote;
Uses crt;
Var A:integer;
Begin
Clrscr;
Writeln(enter your age);
Readln(A);
If(A>=18)then
Writeln(qualified to vote)
Else
Writeln(too young);
Readln;
End.

3. Create a program that determines if the input numbers is a magic number (143) which is equivalent to the magic word: “I LOVE YOU”, if it is equivalent, then display the message.”Right” otherwise display the message. ”Wrong”.
Algorithm:
ENTER N
IF N=143 THEN
PRINT “I LOVE YOU”
ELSE
PRINT “WRONG”
PROGRAM:
Program MagicNumber;
Uses crt;
Var N:integer;
Begin
Clrscr;
Writeln(enter your Number);
Readln(N);

You May Also Find These Documents Helpful

  • Satisfactory Essays

    a1 script win213

    • 380 Words
    • 2 Pages

    If the user does not enter a numeric value the program should prompt for a numeric value…

    • 380 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    It210 Week 4 Psuedocode

    • 584 Words
    • 3 Pages

    = Yes || yes|| No || no Write: “That is not a correct entry!” Write: “Please enter Yes or No.” Input QuitNow…

    • 584 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    CEIS100 W5 ILab Report

    • 320 Words
    • 2 Pages

    The objective was to create a program using python. The program should successfully ask the user to input his or her name. Then ask the user to enter his or her age. If they are older than 16 then they can drive a car. Display this message along with their name. Then end the program by stating the users name, and that it is nice to meet them.…

    • 320 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    2.Write a program to (a) display a “?” (b) read two decimal digits whose sum less than 10 (c) display them and their sum on the next line. Page: 80…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    Program Lovecs.Java

    • 422 Words
    • 2 Pages

    import java.util. Scanner; public class LoveCS { public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("Enter how many times you wish the message to be printed."); int limit = 0; limit= scan.nextInt(); int sum=0; int count=1; while (count <=limit) { System.out.println(count+" I love Computer Science!!"); sum+=count; count++; } System.out.println("Printed this message " + limit + " times."); System.out.println("The sum of the numbers from 1 to "+limit+" is "+sum); } } import java.util. Scanner; public class PowersOf2 { public static void main(String[]args) { int valuePowersOf2; int nextPowersOf2 =1; int exponent= 0; int count=0; Scanner scan = new Scanner(System.in); System.out.println("Enter A Number.");…

    • 422 Words
    • 2 Pages
    Better Essays
  • Good Essays

    ElizabethFlaimFP

    • 1289 Words
    • 7 Pages

    Problem Definition: Design a program that allows a user to input a list of family members, along with their age and the state where they live. The program will determine and print the average age of the user’s family. The program will also print the names of any family member that lives in Texas. The program design should also allow the user to enter at least 50 family members.…

    • 1289 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    In the two articles, “Into the Unknown” and “Lewis and Clark Revisited” by World Almanac have many similarities and differences. For example, these two article are similar because they both were along the Mississippi River. In addition, even though the reenactment was not shot in the exact location, the sites still looked identical. While there are some similarities, there are also many differences. For example, in “into the unknown” they traveled in a boat with oars while crossing waterways where in the reenactment they used a boat with a motor. Also, the first explorers covered themselves in bear grease to protect themselves from mosquitoes where in the reenactment they used rush pills. Finally, explorers first camped in camp wood Illinois…

    • 166 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Programing Problems

    • 721 Words
    • 3 Pages

    IT 210 13 Programming Problems Pseudocode for chapter 2 checkpoint Frank T. Hartman IT 210 13 Programming Problems Pseudocode for chapter 2 checkpoint Frank T. Hartman Programming Problem 1 Main Module Declare SalesAmount As Real Declare CommissionRate As Real Declare CommissionEarned…

    • 721 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    code program

    • 317 Words
    • 2 Pages

    (Compilation screenshot) - Insert here a screenshot of the result of compiling the above source code: NetBeans IDE 7.3.1 compiles but it did not go to the screen so I could see it, this is why I sent you a message yesterday to let you know this. But the program did run without any problems.…

    • 317 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    1. Problem definition: Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas.…

    • 467 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    individual report

    • 1699 Words
    • 7 Pages

    Nowadays it is believed that ethical principles are the foundation of ethical analysis. Each theory can be used for predicting the outcome and following one’s duties to others in order to reach an ethically correct decision. The problems that are discussed in any cases like the AWB LTD scenario can bring significant changes to the decision –making process for others. Also the best approach is to use ethical theories such as Utilitarism, Deontology, Libertarianism etc., in combination in order to obtain the most ethically correct answer and solution possible for each case.…

    • 1699 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    At what age should teens be allowed to vote? Some argue that the voting age should be lowered to 16 years old, while others believe that it should remain the same. 16 years olds lack the responsibility needed to vote. 16 year olds are scientifically proven to be underdeveloped and not fully mature. 16 year olds are frequently liberal until they grow up to have adult responsibilities.…

    • 454 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Another problem may arise of the younger ones is that they only vote to vote. Due to lack of knowledge of politics, most of the younger people won’t have a preferred candidate. They still might vote, though, just because they can. This might cause the wrong political leader to take office because teenagers just want to vote. 16 yr…

    • 386 Words
    • 2 Pages
    Good Essays
  • Good Essays

    · The user enters values for the length and width of a rectangle and clicks the Calculate button or presses the Enter key to activate that button.…

    • 305 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Programming Mini Project

    • 1010 Words
    • 5 Pages

    SOFTWare design FLOWCHART Start define SIZE 52 int getInput1(void); int getBalance(void); int dispData(void); int countAge(void); void getName(char first_name[10]); void getName2(char last_name[10]); int main(void) Declare num,ic, first_name[10],last_name[10], soal,i Print WELCOME TO Intelligence Tech ptd.ltd Main Menu:-) This smart card reader provides you some applications.…

    • 1010 Words
    • 5 Pages
    Satisfactory Essays