Preview

Looping

Satisfactory Essays
Open Document
Open Document
1395 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Looping
UNIVERSITY OF THE EAST - CALOOCAN
COLLEGE OF ENGINEERING
Computer Engineering Department

Assignment #1
NES 113 – EN2C

Submitted To:
Mr. Alexis John M. Rubio
CpE Professor

Submitted By:
Rosit, Laila D.
20101164583

August 15, 2013
3.1. Make a C program that will accept any integers from 1-12 and displays equivalent month, Example if 3, “March”.

#include<stdio.h>
#include<conio.h>
int month; int main()
{
printf("Enter a Month:"); scanf("%d",&month); switch(month)
{
case 1: printf("January"); break; case 2: printf("February"); break; case 3: printf("March"); break; case 4: printf("April"); break; case 5: printf("May"); break; case 6: printf("June"); break; case 7: printf("July"); break; case 8: printf("August"); break; case 9: printf("September"); break; case 10: printf("October"); break; case 11: printf("November"); break; case 12: printf("December"); break; default: printf("1 to 12 only!");
}
getch();
}

3.3. Construct a C program that will enter three integers and display the highest value, assuming all inputs are different.

#include<stdio.h> #include<conio.h> int main() { float num1, num2, num3; printf("Enter three numbers:"); scanf("%f %f %f",&num1,&num2,&num3); if(num1>=num2 && num1>=num3) printf("Highest value= %.2f",num1); if(num2>=num1 && num2>=num3) printf(" Highest value= %.2f",num2); if(num3>=num1 && num3>=num3) printf("Highest value= %.2f",num3); getch() }

3.4. Any customer whose total PURCHASE is at least P1000 will be given a 10% discount. Make C program that would input the customer’s purchase and output his net BILL

#include<stdio.h> #include<conio.h> main() { float dis,price,tot_bill; printf("Enter the price\n"); scanf("%d%f",&price); if(price=1000); {dis=(float)0.10;

You May Also Find These Documents Helpful

  • Satisfactory Essays

    PT1420 Chapter 3 Review

    • 1062 Words
    • 8 Pages

    4. Assume the variables result, w, x, y, and z are all integers, and that w = 5, x = 4, y = 8, and z = 2. What value will be stored in result in each of the following statements?…

    • 1062 Words
    • 8 Pages
    Satisfactory Essays
  • Satisfactory Essays

    cout << "You are in factorial program of C++. Please enter a +ve integer:- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    7. The program will calculate and display a final total for the items that are purchased.…

    • 498 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    ops335 lab 2 firewall

    • 695 Words
    • 4 Pages

    6. Display the tax payable and total purchase price for the book to the customer.(tax + list price = purchase price)- data type decimal…

    • 695 Words
    • 4 Pages
    Good Essays
  • Good Essays

    PRG/420 Week 3

    • 1025 Words
    • 5 Pages

    Scanner; /* * @author * Week 3 Individual Assignment * Assignment: Simple Commission Calculation Project Part 2 * Due Date: */ public class AnnualCompensationCalculator { /** * main method begins program execution */ public static void main(String args[]) { String firstName; // Get user 's first name String lastName; // Get user 's last name int salary; // User 's fixed annual salary double commissionRate; // User 's commission rate double sales; // User 's annual sales double totalCommission; // User 's total commission earned double totalCompensation; //…

    • 1025 Words
    • 5 Pages
    Good 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
  • Satisfactory Essays

    Pt1420 week 2

    • 320 Words
    • 3 Pages

    A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent.…

    • 320 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Pt1420 Assignment

    • 1058 Words
    • 5 Pages

    1) Initialization: the variable is initialized 2) Test: the loop tests the variable by comparing it to the maximum value 3) Increment: to increase the value during each iteration the loop increments the counter variable by adding 1 to it.…

    • 1058 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    The individual assignment for this week tasked the students to select one organization from either our week two assignment or the University material. This paper will show the data in an index using the time series data to forecast inventory for the next year. The Winter Historical Inventory Data from the (University of Phoenix, 2010) shows four years of actual demand of inventory data for the seasonal Winter Highs. Each year is divided into 12 month increments.…

    • 396 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    unit 8 homework

    • 793 Words
    • 5 Pages

    4. Design a loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers entered.…

    • 793 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    Systems Media Table

    • 1302 Words
    • 6 Pages

    | |to bill customers for the use of |(Englebardt, & Nelson, |management of a large number |…

    • 1302 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    unit 3

    • 313 Words
    • 2 Pages

    4. Assume the variables result, w, x, y , and z are integers, and that w=5, x=4, y=8, and z=2. What value will be stored in result in each of the following statements?…

    • 313 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    A retail store gives each of its customers a maximum amount of credit. A customer’s available credit is determined by subtracting the amount of credit used by the customer from the customer’s maximum amount of credit. As you did in programming challenge 1, perform steps 1 through 6 of the programming process to design an application that determines a customer’s available credit.…

    • 636 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    9.) A bug collector collects bugs every day for 7 days. Design a program that keeps a running total of the number of bugs collected during the 7 days. The loop should ask for the number of bugs collected each day, and when the loop is finished, the program should display the total number of bugs collected.…

    • 651 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0.…

    • 748 Words
    • 3 Pages
    Powerful Essays