Program Lovecs.Java

Better Essays
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."); valuePowersOf2=scan.nextInt(); System.out.println(" First 8 "+valuePowersOf2+" powers of 2"); while(exponent<valuePowersOf2) {
System.out.println("2 ^ "+exponent+" = "+nextPowersOf2); while(count<=exponent) { nextPowersOf2*=2; count++;
}
exponent++;
}
}
}

// **********************************************************
// Temps.java
//
// This program reads in a sequence of hourly temperature
// readings (beginning with midnight) and prints the maximum
// temperature (along with the hour, on a 24-hour clock, it
// occurred) and the minimum temperature (along with the hour
// it occurred).
// **********************************************************

import java.util.Scanner;

public class Temps
{
//----------------------------------------------------
// Reads in a sequence of temperatures and finds the
// maximum and minimum read in.
//----------------------------------------------------
public static void main (String[] args)
{
final int HOURS_PER_DAY = 6;

int temp; //a temperature reading int maxTemp = -1000; //maximum temperature int miniTemp = 1000; //minimum

You May Also Find These Documents Helpful

  • Better Essays

    Program

    • 1106 Words
    • 5 Pages

    Pantawid Pamilyang Pilipino Program: “Kaya ng Pinoy tumawid sa Kaunlaran” One afternoon, I bought chips and drinks in a mini-mart. I fall in a long line with people who are too busy checking up their groceries. I heard one talking about the money that they have to budget in a week or two that in some sort helps them in their living. The cash that they had was from a program. I was too curious about the program that they were talking about, what comes next was I found myself talking to one of these…

    • 1106 Words
    • 5 Pages
    Better Essays
  • Better Essays

    Program

    • 1494 Words
    • 6 Pages

    Treatment Program for prisoners Many challenges confront the criminal justice system. One major perennial question is: How can we more effectively deal with individuals who have drug and alcohol problems and are also involved in criminal activity? The complex relationships between drugs and crime have been extensively analyzed. Generally, these studies confirm that drug and alcohol abuse is associated with criminal activity.The magnitude of this problem is also indicated by the recurring finding…

    • 1494 Words
    • 6 Pages
    Better Essays
  • Good Essays

    Program

    • 521 Words
    • 3 Pages

    The discussion of aims b. The analysis of relevant laws and regulations c. The evaluation of the potential of different areas and activities for agricultural activities d. The selection of important categories and areas for detailed programs. e. And lastly an analysis of economic…

    • 521 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Program

    • 1314 Words
    • 6 Pages

    Function Keys , Special-function Keys , Enter etc. (b) Mouse The mouse is a small device used to point to a particular place on the screen and select in order to perform one or more actions. It can be used to select menu commands, size windows, start programs etc. The most conventional kind of mouse has two buttons on top: the left one being used most frequently. Mouse Actions- left click ,double click ,right click etc. (c) Joystick The joystick is a vertical stick which moves the graphic cursor in a…

    • 1314 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Program

    • 314 Words
    • 2 Pages

    or comparison purposes we also ran a triangular distribution to compensate for the lack of symmetry around the expected mean, but the results were broadly similar so we will discuss the results based on the truncated normal distribution. Results: Original Estimate The average total cost of the original over booking settings (5% and 20% respectively, shown in red below) is £9,154. The reason this is higher than Jane’s estimate is that hers was only a single average…

    • 314 Words
    • 2 Pages
    Good Essays
  • Better Essays

    Service Request SR-kf-013 Frequent Shopper Program Paper Gerard Gonzalez Business Systems/BSA310 October 7th, 2010 Joseph Gorman Service Request SR-kf-013 Kudler Fine Foods founder and manager, Kathy Kulder, has requested information on developing a system to track customer purchases through a Frequent Shopper Program. This Program will award loyalty points for redemption to repeat customers. Purchases made by customers whom participate in the program will be tracked and converted into loyalty…

    • 1057 Words
    • 5 Pages
    Better Essays
  • Satisfactory Essays

    Antivirus Programs

    • 333 Words
    • 2 Pages

    Antivirus Programs Today, people rely on computers to create, store, and manage critical information, many times via a home computer network. Information transmitted over networks has a higher degree of security risk than information kept in a user’s home or company premise. Thus, it is crucial that they take measures to protect their computers and data from loss, damage, and misuse resulting from computer security risks. Antivirus programs are an effective way to protect a computer against…

    • 333 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Wellness Program

    • 1250 Words
    • 5 Pages

    Employee Wellness Programs Help to Foster Retention and Wellbeing in the Workplace J P MGMT 351 Abstract Amid the stress and tension most employees face on a daily basis in the workplace, wellness programs are setup to help alleviate the health risks brought on by prolonged stress. Along with the health benefits of wellness programs, they also maintain employee retention and job satisfaction. From the research, wellness programs have grown considerably since the 1980’s. Even though…

    • 1250 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Program and Initiative

    • 431 Words
    • 2 Pages

    Reflective The most compelling aspect of this project has been finding the resources to start my initiative. I didn’t realize how many community programs Durham had to offer. It really gave me hope for the youth in my community. The only issues that I could see was in finding the right fit for the right youth. Once I started to research programs, it really informed me of how very important youth are in our community. In order to help our youth succeed, we must be willing to come together and…

    • 431 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Tv Program

    • 406 Words
    • 2 Pages

    people believe that TV programs are no value. Do you agree ? Since our parents' generation, the argument of the value of TV programs was begin. People debate about the advantages and disadvantages of the TV programs. Today, same like most of the IT product, TV is become the integral part of a family. If say all the TV programs are no value to people, that means most of the human in the world are probably make the same mistake. Obviously, it is not true. TV programs bring a lot of benefits…

    • 406 Words
    • 2 Pages
    Satisfactory Essays