plzz help me with this question.........

Write a program to input a number find the sum of digits and the number of digits. Display the output also.......

sample input - 7359
sample digits - 24
number of digits - 4​

Answers

Answer 1

Answer:

please mark as brainliest!!

Explanation:

public class SumOfDigits{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Please enter a number to calculate sum of digits"); int number = sc.nextInt(); // Remember number/10 reduces one digit from number // and number%10 gives you last digit int sum = 0; int input = number; while (input != 0) { int lastdigit = input % 10; sum += lastdigit; input /= 10; } System.out.printf("Sum of digits of number %d is %d", number, sum); // closing Scanner to prevent resource leak sc.close(); } }


Related Questions

Which of the following best describes the protocol used on the internet?

Answers

Answer:

The protocols of the Internet are open and used by all devices connected to the network

Explanation:  

There are billions of devices connected to the Internet, and hundreds of different kinds of devices: laptops, tablets, phones, refrigerators, handheld credit card readers, and so on. Protocols (standards) ensure that the variety of devices interact with each other smoothly.  There are a lot of protocols! The Internet was designed with several layers of abstraction that sort the protocols according to what part of the process they support.

Which examples demonstrate common education and qualifications for Manufacturing Production Process Development careers? Check all that apply. Answer: A. Hugo uses CAD software to create a product design. D. Latisha is a Mechanical Engineer with a bachelor's degree. E. Oliver carefully calculates the dimensions of a product.

Answers

Answer:

A D E

Explanation:

I got it right on Edge.

Answer:

A D E

Explanation:

just did the work

:)))))

Which best describes what databases do?

They guarantee users find needed data.
They create categories for data.
They identify important data.
They enable users to search for data.

Answers

Answer:

I think the first one

Explanation:

not sure you can also do some research bout it

Zack sees an online contest. He could win $10,000 instantly! On the sign-up form he enters his name and email address. He is also asked to enter his nickname, the name of any pets, and his mom's maiden name. Should he do it?

Answers

Answer:

Do not please! Online hackers and identity thieves can use such informations or clues to figure out Zack's passwords.

Explanation:

In this scenario, Zack sees an online contest stating that he could win $10,000 instantly! On the sign-up form he enters his name and email address. He is also asked to enter his nickname, the name of any pets, and his mom's maiden name.

Hence, it is advisable, that Zack shouldn't do it because online hackers and identity thieves can use such informations or clues to figure out Zack's passwords.

Basically, this type of cyber attack is simply known as baiting in social engineering.

Social engineering can be defined as a manipulative strategy or technique that involves the use of deceptive and malicious activities on unsuspecting victims in order to gain unauthorized access to their confidential or private information for fraud-related purposes. Some examples of social engineering are quid pro quo, phishing, baiting, tailgating etc.

how to find radius of the base examples ​

Answers

Answer:radius is half the diameter

Explanation:

Major innovations made from the establishment of abucus to the 5th computer generation

Answers

Answer:

Cogs and Calculators

It is a measure of the brilliance of the abacus, invented in the Middle East circa 500 BC, that it remained the fastest form of calculator until the middle of the 17th century. Then, in 1642, aged only 18, French scientist and philosopher Blaise Pascal (1623–1666) invented the first practical mechanical calculator, the Pascaline, to help his tax-collector father do his sums. The machine had a series of interlocking cogs (gear wheels with teeth around their outer edges) that could add and subtract decimal numbers. Several decades later, in 1671, German mathematician and philosopher Gottfried Wilhelm Leibniz (1646–1716) came up with a similar but more advanced machine. Instead of using cogs, it had a "stepped drum" (a cylinder with teeth of increasing length around its edge), an innovation that survived in mechanical calculators for 300 hundred years. The Leibniz machine could do much more than Pascal's: as well as adding and subtracting, it could multiply, divide, and work out square roots. Another pioneering feature was the first memory store or "register."

Apart from developing one of the world's earliest mechanical calculators, Leibniz is remembered for another important contribution to computing: he was the man who invented binary code, a way of representing any decimal number using only the two digits zero and one. Although Leibniz made no use of binary in his own calculator, it set others thinking. In 1854, a little over a century after Leibniz had died, Englishman George Boole (1815–1864) used the idea to invent a new branch of mathematics called Boolean algebra. [1] In modern computers, binary code and Boolean algebra allow computers to make simple decisions by comparing long strings of zeros and ones. But, in the 19th century, these ideas were still far ahead of their time. It would take another 50–100 years for mathematicians and computer scientists to figure out how to use them (find out more in our articles about calculators and logic gates).

Explanation:

What is the function of a web browser, and what are the main components of a web address?

Answers

Answer:

The primary function of a web browser is to render HTML, the code used to design or "mark up" webpages. Each time a browser loads a web page, it processes the HTML, which may include text, links, and references to images and other items, such as cascading style sheets and JavaScript functions.

Function of a web browser: A web browser allows users to access and view websites on the internet, request web pages from servers, and display their contents.

Main components of a web address (URL):

1. Protocol

2. Domain

3. Subdomain

4. Path

5. Query parameters

6. Fragment identifier

The Function of a Web Browser:

1. Requesting Web Pages: The web browser sends requests to web servers to fetch specific web pages or resources (such as images, videos, and stylesheets) associated with those pages.

2. Rendering Web Pages: Once the web browser receives the requested content from the server, it interprets and renders the HTML, CSS, and JavaScript code to display the web page's content and structure.

3. Supporting Multimedia: Web browsers are capable of handling various multimedia elements, such as images, audio, and video, allowing users to experience a rich and interactive web environment.

4. Managing History and Bookmarks: Web browsers keep track of the browsing history, allowing users to revisit previously visited sites. They also provide features to bookmark and save favorite websites for quick access.

Main Components of a Web Address (URL):

A web address, also known as a URL (Uniform Resource Locator), is the unique address used to identify a specific web page or resource on the internet. It consists of several components:

1. Protocol: The protocol is the method used to access the resource.

2. Domain: The domain is the address of the website or server hosting the resource. It is typically the main part of the URL.

3. Subdomain (Optional): Subdomains are prefixes added before the main domain.

4. Path: The path specifies the location of the specific resource on the server. It may include directories and filenames.

5. Query Parameters (Optional): Query parameters are additional data passed to the web server for processing.

6. Fragment Identifier (Optional): The fragment identifier is used to specify a specific section or anchor within a web page.

Learn more about Web here:

https://brainly.com/question/27961981

#SPJ6

objets will never appear to have more than one vamishing point
true or false

Answers

Answer: it’s True

Explanation:

BRAINLIEST!!! HELP!!! 20 PNTS!!

Which is the correct way to add a border color?

A. border-color(red);

B. border-color: red;

C. red: border-color;

D. border-color = red;

Answers

Answer:

The answer you are looking for is "B.) border-color: red"

HTML and CSS coding is fairly simple, but to assign a border color to a certain tag, you would write

Tag Name (without <>'s)

{

border-color: red

}

Remember that your border color will affect all of the tags mentioned in this command.

What is the purpose of slicing?

a. To combine characters in order to form a single string
b. To combine two or more strings into one big string
c. To pull out a group of characters from a string
d. To pull out one specific character from a string

Answers

Answer:

C

Explanation:

Because a and b are talking about combining and when you slice you don't combine when you slice and when you slice something its into 2 or more parts, unlike what d says

(Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20s, 10s, 5s, and 1s. Example output: $452 converted is 22 $20s, 1 $10s, 0 $5s, and 2 $1s.​

Answers

Answer:

Below!

Explanation:

This is the code I have. I am not sure what I am missing that it won't accept -  

import java.util.Scanner;

class Dollars {

   public static void main(String[] args) {

            int numTwenties,numTens,numFives,numOnes,dollarAmount;  

       Scanner sc= new Scanner(System.in);

       System.out.println("Please enter a dollar amount: ");  

       dollarAmount = sc.nextInt();

        numTwenties = dollarAmount/20;

        numTens = (dollarAmount - 20*numTwenties)/10;

        numFives = (dollarAmount - (10*numTens + 20*numTwenties))/5;

        numOnes = (dollarAmount - (10*numTens + 20*numTwenties + 5*numFives));

       System.out.println(+ dollarAmount + " converted is" + numTwenties + " $20s, " + numTens + " $10s, " + numFives + " $5s, and " + numOnes + " $1s.");  

   }

}

This is what it is giving me -

Test CaseIncomplete

Dollars 598

Input598

OutputPlease enter a dollar amount: 598

598 converted is29 $20s, 1 $10s, 1 $5s, and 3 $1s.

Results

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

Expected Output

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

It's mainly the price measure with one currency against the other, even as rate changes, money through one country can get relatively weak or powerful in comparison with the other currencies, and the further program can be defined as follows:

Program Explanation:

Import package.Defining a class Conversion .Defining an integer variable "twenties, tens, fives, ones, amount, n".After defining a variable, a Scanner class object is declared that inputs value in it.In the next step, a conditional statement is declared that checks value and hold its calcuated value.At the last, a print method is declared that prints its value.

Program:

import java.util.*;//import package  

public class Conversion //defining a class Conversion

{

   public static void main(String ar[])//defining a main method

   {

       int twenties, tens, fives, ones, amount, n;//defining an integer variable

       Scanner obcdf= new Scanner(System.in);//creating Scanner class object to input value

       System.out.println("Enter amount: ");//print message

       amount = obcdf.nextInt(); //input integer value

       n =  amount; //holding innput value

       if(amount > 20)//using if block that check amount value greater than 20

       {

           twenties = (int)(amount/20); //using twenties that divides amount value by 20 and hold its integer value  

           amount = amount % 20;// holding modules value in amount variable

       }

       else  //defining else block

       {

           twenties = 0;//holding 0 in twenties variable  

       }

       if(amount > 10)//using if that check amount value greater than 10

       {

           tens = (int)(amount/10);//using tens that divides amount value by 10 and hold its integer value

           amount = amount % 10;// holding modules value in amount variable

       }

       else  //defining else block

       {

           tens = 0;//holding 0 in tens variable  

       }

       if(amount > 5)//using if that check amount value greater than 5

       {

           fives = (int)(amount/5);//using tens that divides amount value by 5 and hold its integer value

           amount = amount % 5;// holding modules value in amount variable

       }

       else //defining else block

       {

           fives = 0;//holding 0 in fives variable  

       }

       if(amount > 1)//using if that check amount value greater than 1

       {

           ones = (int) amount;//holding amount value in ones variable

       }

       else //defining else block

       {

           ones = 0;//holding 0 in ones variable

       }  

       System.out.println("$"+n+" converted is "+twenties+" $20s, "+tens+" $10s, "+fives+" $5s, and "+ones+" $1s."); //print value

   }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/4448370

what do you understand by the term "Artificial Intelligence "?​

Answers

Answer:

Artificial Intelligence (AI) is the branch of computer sciences that emphasizes the development of intelligence machines, thinking and working like humans. For example, speech recognition, problem-solving, learning and planning.

What do you mean by word-wrap?

Answers

Answer:

it is also know as line breaking

Explanation:

is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area

just hellllllp me plzzzzzzzzzzzzz

Answers

it should increase the amount of thrust

Answer:

It is C.

Explanation:

Hope this helped have an amazing day!

If you got band from a local library, what would be the reason for it besides shouting and talking? You're answer has to fit you're personality?

Answers

Answer:

I would get a band from the library because I check out ten books and returned them in a week. I also would just be in the library all the time and they would get frustrated. That or I would spend hours talking to a librarian about my favorite books and they would get fed up with me.

b) Describe the computer processing that is required to maintain the correct growing
conditions.​

Answers

Answer:

Explanation:To get the best plant growing conditions, the temperature and humidity (moisture in the air) have to be controlled.

The greenhouse therefore has temperature and humidity sensors linked to a computer, and the computer has a control program storing details of the correct temperature and humidity settings. The greenhouse is fitted with a heater, sprinkler and window motor which are also linked to the computer.

If the humidity falls below the values stored in the program, the computer activates the sprinklers and closes the windows. If the temperature falls outside the values stored in the program, the heater is activated by the computer.

PLS HELP BEING TIMED!!!!
Why do prospective lenders only accept FICO credit reports that are one or two days old, at most?
O Good credit scores can plummet quickly
O Credit scores change on a daily basis.
O Bad credit scores can improve quickly.
O Credit reports expire after two days and are no longer valid.

Answers

Answer:

O Credit scores change on a daily basis.

Explanation:

Which term refers to the portion of the hard drive where print jobs are stored before going to the print device

Answers

Answer:

Print Queue.

Explanation:

I majored in Technology

Printer spoolers, which queue print jobs and send them one at a time to a printer, should not be confused with printer drivers.

What print jobs are stored before going to the print device?

In order to enable control of print queue actions like stopping, restarting, or canceling tasks, a print queue provides users with printer management features. Some print queues let users rearrange the queue's order and assign print jobs a higher priority.

Messages that need to be printed are gathered in print queues. An Unspecific print queue can be started or canceled.

Applications can print with the help of printer drivers without having to be aware of the specific technical specifications of each printer model.

Therefore, The area of the hard disk where print jobs are kept before being sent to the printer is referred to as the print queue.

Learn more about print device here:

https://brainly.com/question/4005823

#SPJ6

Can someone help me get spotify premium

Answers

Answer:

Yes just go to spotify and pay for spotify premium.

Explanation:

Answer:

Buy it, go to the app store or google play and it will surely pop up like a sign saying premium.

Explanation:This is so hard :/

Which of the following is NOT true regarding fonts which should be used in memos?
O Typically serif fonts are used such as Times New Roman
O Typically sans-serif fonts are used such as Arial
O Headers should be 12-point font size
O Body text should be 10-point font size

Answers

Answer: Typically serif fonts are used such as Times New Roman.

Explanation: Have a gr8t day and pls mark me brainliest.

What is a letter that is written by someone you know and is used by a college during the application process?

Answers

Letters of recommendation.

Answer:

Letters of recommedation ..

Explanation:

When do you use a for loop?

Answers

Answer:

You use a for loop when you know how many times you want to run the loop

Explanation:

if you dont know, use a while loop

help plz (will give brainliest)

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This is the python program in the question that is:

def sum(n1,n2):

n=n1+n2

return n

The question is: write a function CALL that displays the return value on the screen.

So, the correct program is written below:

*********************************************************************  

def sum(n1,n2):# it is function that define sum

 n=n1+n2 # variable n that store the result of n1 and n2

 return n # return the result

print(sum(3,5))# call the sum function with parameter 3 and 5 , it will print 8

print(sum(4,101))

# call the sum function with parameter 4 and 101 it will print 105

********************************************************************************

you can also store the sum result into another variable, because this function return the sum. So, you can store that return value into another vairable and using the print function, to print the value of this variable such as:

*****************************************************************************

def sum(n1,n2):# it is function that define sum

n=n1+n2 # variable n that store the result of n1 and n2

return n # return the result

result= sum(6,9) # store the sum result into another variable i.e result

print(result)# print the result variable value

*****************************************************************************

Why would it be useful to split up the coding for creating an app between multiple programmers? Select 2 options.

greater innovation

greater control over the code.

faster development.

greater consistency between sections of code.

Answers

Answer: c

Explanation:

Answer:

I'd be willing to wager it is A and D but not 100% sure.

Explanation:

Eli needs to export files from his mailbox into a single file that is portable and can be backed up to removable media. Which file type will he use?

Answers

Answer:

PST

Resource:

This question has already been answered here: https://brainly.com/question/18415952

Explanation:

PST is the personal storage table, which is a file built by Microsoft to store data from outlook and other services too.  Really quick, this may or may not be an option that you are looking for but, what I would do in my opinion would be to use the PST and export it on a removable USB, since USBs are removeable media.

Which visual novels do you recommend and why?

Answers

Answer:

I rec recommend Fate/Stay Night. It's honestly so good!

Explanation:

Can we trust in Avast Antivirus ⊕?⊕

Answers

Answer:

yes we can

Explanation:

im also using avast antivirus and it was no fault in avast antivirus

Answer:

Avast is a good antivirus program. It is not a scam or malware. I personely use Avast a while back and they are now basically the same thing, only with a different user interface.

Explanation:

Hope It's answer you plz mark as Brainlist

can some one please help

Answers

Answer: It probably will cost a lot of money

Explanation:

The Internet:

O A. only gives us access to our local communities.

O B. hinders our ability to influence people.

O C. limits us to local social networking sites.

O D. enables us to join global online communities.​

Answers

Answer:

D- it enables us to join global online communities.

Explanation:

Thanks to social media and other websites, content you produce can be seen all over the world.

answer this now
and thanks

Answers

Answer:

the process of burning something

Answer:

Option D) the process of burning something

Explanation:

Combustion, or burning, is a high-temperature exothermic redox chemical reaction between a fuel and an oxidant, usually atmospheric oxygen, that produces oxidized, often gaseous products, in a mixture termed as smoke. 

Other Questions
15PTS PLEASE HELP ASAP!(dont write random answers pls)look at the pic attached: C3H5OH + 3 O2 --> CO2 + H2O When balancing the equation above, how many molecules of CO2 and H2O are produced? The first half is already balanced. How did Napoleon come to power? Why are rivers of nepal not suitable for transportation? Give reason. What are the main two polytheistic religions? A 1370-kg small aircraft accelerates along the runway from 7.4 m/s to 37.8 m/s in 5.20 seconds. Determine the net force acting upon the plane. (Assume that its engine/propeller makes no contributes to its forward motion) Which of the following is a unit of acceleration? Aides in the burning of materials. Needed for humans to breathe. Peter's Grandma has very severe memory loss. Which of the following could she be suffering from?A. Spina bifidaB. QuadriplegiaC. EpilepsyD. Alzheimer's Find the solution to the system 5x+4y=-34 and y=3x The value of x, rounded to the nearest tenth is... What was one difference between hunter-gatherer societies and early farming societies? Villagers spent most of their time doing things other than farming, while hunter-gatherers spent most of their time getting food. Hunter-gatherers brought food back to their settlements from far away, while villagers did their farming close to their settlements. Hunter-gatherers moved around to find sources of food, while villagers settled in one place to grow food, trade, and specialize. Villagers learned to build permanent homes while hunter-gatherers had to seek shelter in nearby villages to survive bad weather. starting in the 15th century leaders in China and Japan decided to cut off contact with other countries which is not a reason for doing this A company had a beginning balance in retained earnings of $43,300. It had net income of $6,300 and declared and paid cash dividends of $5,700 in the current period. The ending balance in retained earnings equals: Look at this model of an atom. Where are the protons located and how many are there? On a coordinate plane, how are the locations of the points (5 , -7) and (-5 , 7) related?A. reflection across the y-axis B. reflection across the x-axis C. locations unrelated D. reflection across both axes crossword for john locke Margo can purchase tile at a store for $0.69 per tile and rent a tile saw for $36. At another store she can borrow the tile saw for free if she buys tiles there for $1.29 per tile. How many tiles must she buy for the cost to be the same at both stores? I need help with an explanation PLS HELP QUICK!!!!!Which statement best completes the diagram? Cause: Martin Luther criticizes the Catholic Church.effect:O A. Protestantism is formed.O B. The Orthodox Church is created. O C. Jesus of Nazareth is crucified. O D. The Catholic pope wins more power.