Question

Java Did you know you can count on one hand the number of concepts you must...

Java

Did you know you can count on one hand the number of concepts you must be able to express in a programming language to officially say you have a beginner's level of mastery? Really! That's why I call this hands-on "Gimme Five!"

  • input/output
  • declare (name / space allocation) and initialize (assign value to) variables
  • iteration (looping)
  • selection (decision / IF-THEN)
  • comments

THE CHALLENGE

Your hands-on assignment this week is to write a small program in the NEW LANGUAGE you've chosen to learn that illustrates all FIVE of these concepts.

To fulfill the "comments" concept, do the following:

  • insert a comment at the top of your program that states the language you have chosen to learn.
  • insert comments elsewhere in the code to point out to me where each of the other concepts is illustrated.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

// I have choosen Java Programming language

import java.util.Scanner;

public class EvenNumbers {
public static void main(String[] args) {
   Scanner sc = new Scanner(System.in);
   // here I am reading the input from the user
   /* Input output concept*/
   System.out.println("Enter number ");
   int n=sc.nextInt();
   // iterating till the given and checking if it is even
   // Loop (iteration)
   for(int i=0;i<n;i++){
       // selection
       if(i%2==0){
           System.out.println(i);
       }
   }
}
}

Add a comment
Know the answer?
Add Answer to:
Java Did you know you can count on one hand the number of concepts you must...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Evaluate the arical writ the response in which you state your agreement or disagreement with writer...

    Evaluate the arical writ the response in which you state your agreement or disagreement with writer up un these questions guidelines 1) can empathy lead us astrary? how 2) our heart will always go out to the baby in the well, its a measure of our humanity. but empathy will have to yield to reason if humanity is to have a future can empathy yield to reason? how? thank you The Baby in the Well: The Case against Empathy* -Paul...

  • Discussion questions 1. What is the link between internal marketing and service quality in the ai...

    Discussion questions 1. What is the link between internal marketing and service quality in the airline industry? 2. What internal marketing programmes could British Airways put into place to avoid further internal unrest? What potential is there to extend auch programmes to external partners? 3. What challenges may BA face in implementing an internal marketing programme to deliver value to its customers? (1981)ǐn the context ofbank marketing ths theme has bon pururd by other, nashri oriented towards the identification of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT