1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bulgar [2K]
2 years ago
7

Write a program that asks the user for a positive integer value. The program should use a loop to get the sum of all even intege

rs from 0 up to the number entered, and then display the sum. For example, if the user enters 11, the loop will find the sum of 2, 4, 6, 8, and 10. Input validation: Do not accept a negative number or 0 from user input
Computers and Technology
1 answer:
lapo4ka [179]2 years ago
5 0

import java.io.*;

public class GFG {

   // Returns true if s is

   // a number else false

   static boolean isNumber(String s)

   {

       for (int i = 0; i < s.length(); i++)

           if (Character.isDigit(s.charAt(i)) == false)

               return false;

       return true;

   }

   // Driver code

   static public void main(String[] args)

   {

       // Saving the input in a string

       String str = "6790";

       // Function returns 1 if all elements

       // are in range '0 - 9'

       if (isNumber(str))

           System.out.println("Integer");

       // Function returns 0 if the

       // input is not an integer

       else

           System.out.println("String");

   }

}

You might be interested in
Which of the following is not a valid SQL command? (Points : 2) UPDATE acctmanager SET amedate = SYSDATE WHERE amid = 'J500';
Volgvan

Answer:

UPDATE acctmanager WHERE amid = 'J500';

Explanation:

The statement written above is not valid SQL statement because there is no SET after UPDATE. Update is always used with SET.If you are updating something then you need to specify the value with which that value should be replaced.

UPDATE acctmanager SET amname = UPPER(amname);

This statement does not contains WHERE clause but it will run all the values of amname column will get updated in the table acctmanager.

6 0
3 years ago
Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
Akimi4 [234]

Web conferencing is an internet technology that allows people in remote locations collaborate in a virtual conference room by making presentations and sharing visual aids.

Let me know if you have any questions.

8 0
4 years ago
Read 2 more answers
What is the difference between manual and computer typesetting?
Burka [1]

Answer:

Manual typesetting: The form was placed in a press, inked, and an impression made on paper. During typesetting, individual sorts are picked from a type case with the right hand, and set into a composing stick held in the left hand from left to right, and as viewed by the setter upside down.

Computer typesetting: Computerized typesetting, method of typesetting in which characters are generated by computer and transferred to light-sensitive paper or film by means of either pulses from a laser beam or moving rays of light from a stroboscopic source or a cathode-ray tube (CRT).

6 0
3 years ago
If you must apply for a loan, you should _____. contact a broker and provide certain loan information visit a loan officer at a
azamat
B.) V<span>isit a loan officer at a financial institution and complete an application.</span>
4 0
3 years ago
Read 2 more answers
When the + operator is used with strings, it is known as the?
Darya [45]
Concatenation, which mean we combine two or more strings into one.
5 0
3 years ago
Other questions:
  • Susan bought a new sweater on sale for $28.93.she was charged HST of 13%.find the total amount of her bill including taxes.​
    9·1 answer
  • Which type of lenses shrinks the image in front of it rather than magnifying it? A)Telephoto B)Optical zoom C)Digital zoom D)Wid
    10·1 answer
  • Briefly describe the client/server model.
    8·1 answer
  • Sometimes, fourth-generation languages (4GLs) are called procedural languages
    9·1 answer
  • How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
    5·1 answer
  • Write a program that takes the account's present value, monthly interest rate, and the number of months that the money will be l
    5·1 answer
  • Please help im not good at computer class ​
    10·2 answers
  • The find_item functions uses binary search to recursively locate an item is the list, returning true if found, false otherwise.
    13·1 answer
  • Define a method calcPyramidVolume with double data type parameters baseLength, baseWidth, and pyramidHeight, that returns as a d
    8·1 answer
  • College entrance requirements are the expectations for admission.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!