Using a while loop, create an algorithm extractDigits that prints the
individual digits of a positive integer.
For instance, extractDigits(54321); would create the output:
1
2
3
4
5
Hint: The % and the / operators are going to be very useful in this program.
How can you use these to extract the last digit of the glven number?

Answers

Answer 1

Answer:

Follows are the code to this question:

#include <stdio.h>//defining header file

void extractDigits (int n)//defining a method extractDigits that holds

{

int x;//defining integer variable

   while (n > 0)//defining while loop for check value is greater than 0

   {

       x = n % 10;//holding remainder value

    n = n / 10;// holding quotient value

       printf("%d\n", x);//print remainder value

   }

}

int main ()//defining main method

{

extractDigits (54321);//calling above method by passing integer value

}

Output:

1

2

3

4

5

Explanation:

In the above-given code a method "extractDigits" is defined that accepts an integer parameter, and inside the method an integer variable is declared, that use while loop to check value is greater than 0, and calculate the individual digits, and print its values, and inside the main method we call the above method.    


Related Questions

Ben wants to create a Book class that has an instance variable serialNumber. Where should he declare the instance variable

Answers

Answer:

within the Book class but needs to also be outside of any methods.

Explanation:

If Ben is creating an entire Book class then the instance variable needs to be within the Book class but needs to also be outside of any methods. If Ben places the variable inside a method it can only be used by that method and therefore becomes an instance variable of that method and not the class. By creating it inside the class and outside the methods it can be used every single time a Book object is created. Therefore, creating an instance variable of serialNumber every time.

what is the difference between application software and system software​

Answers

Answer:

system software

1. system software is used for operating computer hardware.

2.system software is installed on the computer when the operating system is installed.

application software

1.it is used for performing specific task.

2.it is installed according to the user's requirements.

Universal Containers (UC) wants to customize basic Salesforce Reports using Lightning Experience. In which two ways can Reports be customized? Choose 2 answers v A. Add a chart. B. Add a Lightning Component. C. Add links to external pages. D. Add a filter.

Answers

Answer:

A. Add a chart.

D. Add a filter.

Explanation:

Workflow management systems can be defined as a strategic software application or program designed to avail companies the infrastructure to setup, define, create and manage the performance or execution of series of sequential tasks, as well as respond to workflow participants.

An example of a work management system is Salesforce.com.

A Salesforce Reports using Lightning Experience refers to an intuitive and powerful software tool used for visualizing and analyzing Salesforce data such as customization, filtering, grouping and creating a summary report.

In this scenario, Universal Containers (UC) wants to customize basic Salesforce Reports using Lightning Experience.

Hence, the two ways in which Reports can be customized are by adding a chart and a filter.

CAN SOMEONE DO OR LOOK UP THE PIE CHART FOR THIS ANSWER PLS AND I WILL MARK YOU BRAINLIEST BUT PLSSS HELP MEEEE!!!

Answers

Answer:

I highly recommened you use ggl charts.

Explanation:

It's free. ALL YOU NEED IS AN GGL ACCOUNT. You can also choose many types of graph you want.

Which of the following represents the relationship between malware and cyber terrorism? (Select all that apply).

Both are used to disrupt network service.

Both involve the use of illegal software.

Cyber terrorists can use malware as a weapon.

Network risk analysts work to prevent both.

Answers

Answer:

Both are used to disrupt network service

Cyber terrorists can use malware as a weapon

Both involve the use of illegal software

Network risk analysts work to prevent both

All are valid.

Answer:

Its all four

Explanation:

edg2021

Id k why the other person got b ad rati ngs, because it is true and they both do all of these things.

Identify the potential problem(s) involved with generating or collecting valid data.
A. Cost.
B. Bias.
C. Error.
D. Access to data.
E. All of the above.
F. None of the above.

Answers

Answer:

B. Bias.

C. Error.

Explanation:

Two of the biggest problems that can occur when generating or collecting valid data are Bias and Errors. Biases automatically make the collected data invalid since this causes the data those involved to purposefully skew the data towards the direction that best suits their biases/beliefs which makes the entire study invalid and therefore the data as well. The second main problem would be human error such as entering the wrong data numbers, choosing the wrong subject, losing the data itself, etc. Humans make mistakes and making one during a study can immediately invalidate all of the data that has been collected.

Do you think that ethics training can really be effective in changing the behavior of employees? Why or why not?

Answers

When employees follow ethical standards, they don't cut corners or short-change the company or its customers. ... Ethical conduct boosts morale and promotes teamwork. When employees can trust one another and management, they can work together more harmoniously and effectively

Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the count of how many numbers were entered.

Sample Run Enter a number: 1 Enter a number: 41 Enter a number: 36 Enter a number: 25 Sum: 103 Numbers Entered: 4

Answers

total = 0

count = 0

while total<=100:

   total += int(input("Enter a number: "))

   count += 1

print("Sum:",total)

print("Numbers Entered:",count)

I wrote my code in python 3.8. I hope this helps

Answer:

total = 0

count = 0

while total<=100:

  total += int(input("Enter a number: "))

  count += 1

print("Sum:",total)

print("Numbers Entered:",count)

Explanation:

create a pl/SQL block to retieve and display information for a specific pledge. Display the pledge ID, donor ID, Pledge Amount, total paid so far and the difference between the pledge amount and total paid amount

Answers

Answer:

SELECT pledge_ID,

             donor_ID,

              pledge_amount,

              total_paid,

              pledge_amount - total paid

   FROM pledges;

Explanation:

The SELECT statement initiates the display command. It states the variables to be selected.

The variables are usually separated by a comma.

The FROM statement indicates the location from which the variables ne selected from.

; signifies the end of the query, stating that the query should be run.

Relationship between sped and time on statistics

Answers

The speed of a moving body is the distance travelled by it in unit time. If the distance is in km and time is in hours, then the speed is km/hr. If the distance is in m and the time is in seconds, then the speed is m/sec.

define an array of 12 structures of type DayMon. Name the array maps[] and initialize the array with the names of the 12 months in a year and the number of days in each month.

Answers

Answer:

#include<stdio.h>

int main(){

 

   int i,n;

   char* maps[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

   for(i=0;i<12;i++){

       printf("%s\n", maps[i]);

   }

   printf("\n");

 

   int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};

   for(i=0;i<12;i++){

       printf("%s %d\n", maps[i], days[i]);

   }

   printf("\n");

 

   return 0;

}

Explanation:

The C source code above declares two arrays, the maps array which is initialized with the months of the year and the days array which is initialized with the number of days of each month in the maps array. Both arrays are printed out side by side like a table of months and the days in each month.

Confidential corporate data was recently stolen by an attacker who exploited data transport protections.Which of the following vulnerabilities is the MOST likely cause of this data breach?

a. resource exhaustion on the vpn concentrators
b. weak ssl cipher strength
c. improper input handling on the ftp site
d. race condition on the packet inspection firewall

Answers

Answer:

c. improper input handling on the FTP site

Explanation:

Improper input handling on the FTP site is associated with encrypting and/or decrypting of input data. It has been observed that input handling on the FTP site is one of the leading causes of vulnerabilities found in contemporary's systems and applications, this is a result of application trusting which helps to establish restrictions and prevent Improper Input Handling attacks accurately.

Hence, in this case, the correct answer is "improper input handling on the FTP site"

Given the following word addresses: 3, 180, 43, 2,191, 88, 190, 14, 181, 44, 186, 253

a. Show the final cache contents for a three-way set associative cache with two-word blocks and a total size of 24 words. Use LRU replacement. For each reference identify the index bits, the tag bits, the block offset bits, and if it is a hit or a miss.
b. Show the final cache contents for a fully associative cache with one-word blocks and a total size of 8 words. Use LRU replacement. For each reference identify the index bits, the tag bits, and if it is a hit or a miss.
c. What is the miss rate for a fully associative cache with two-word blocks and a total size of 8 words, using LRU replacement? What is the miss rate using MRU (most recently used) replacement? Finally what is the best possible miss rate for this cache, given any replacement policy?

Answers

Answer:

A. index bits = 2, tag bits = 2, block offset bits = 1, it is a miss.

B. index bits = 2, tag bits = 1, block offset bits = 0, it is a hit

C. the miss rate is 0

Explanation:

a. number of blocks = 12

number of blocks per set = 3

number of set = number of blocks / number of blocks per set = 12/3 = 4

word size = 24

block size = 2

the block offset = [tex]log_{2}[/tex] block size

   = [tex]log_{2}[/tex] 2 = 1

the index bits = [tex]log_{2}[/tex] number of set = [tex]log_{2}[/tex] 4 = 2

the tag bits = ([tex]log_{2}[/tex] word size) - offset - index = ([tex]log_{2}[/tex] 24) -2 - 1 = 5 -2 - 1 = 2

b. word size = 8

block size = 1

the block offset = [tex]log_{2}[/tex] block size

   = [tex]log_{2}[/tex] 1 = 0

the index bits = [tex]log_{2}[/tex] number of set = [tex]log_{2}[/tex] 4 = 2

the tag bits = ([tex]log_{2}[/tex] word size) - offset - index = ([tex]log_{2}[/tex] 8) -2 - 1 = 3 - 0- 2= 1

Certification is a requirement in pursuing a career as a line installer.

True

False

Answers

Answer:

False

Explanation:

This is rue because, in line installation career, there is no single need for certification but rather to acquire the required skill.

The ability to learn how to be a line installer from an experienced personel is far important than someone who tried to obtain a certification without any acquired skilled to show for it.

Answer:

False

Explanation:

edg2021

Employer training or apprenticeships are required of electrical line installers and repairers. These programs often last up to five years. Certification is not mandatory; however, certification for line installers and repairers is available and does show that you have the right skills and knowledge for this technical job. Often learning on the job is the best way to get experience in this type of position, but it still requires basic understanding of equipment, data communications, and the physical layer of a network.

The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for termination.

Answers

Answer:

"Cross-training " seems to be the right response.

Explanation:

Cross-training seems to be the method of constructing a multi-professional workers staff with incentive plans to make sure that they must have the same tools to complete different occupational tasks throughout the organization. This will be a very broad approach besides randomized controlled training methods, both maximum and minimum frequency, for generations.

Match the example with the type of collection.
___('casa': 'house')
___[3,5]
___(3, 5, 'dog')
A) list
B)tuple
C)dictionary

Answers

Answer:

1.c

2.list

3.tuple

Explanation:

Dictionary—('casa': 'house'), List - [3,5], Tuple - (3, 5, 'dog') are the example with the type of collection. Hence,

What is collection?

A collection is a group of things, usually one that someone has assembled. For instance, many kids have a collection of comic books. The term "collection" contains the word "collect." If you enjoy collecting things, there's a good chance you already have a collection of some kind.

4 The Concept of "Collection" A collection is a gathering of things that have been picked out with a specific goal in mind. Similar ideas include Set, Aggregation (data modeling), Dataset (science and business), and Corpus (linguistics and literary analysis). We favor collecting since it is less defined and has fewer connotations.

Old French collection, a noun of action from the past-participle stem of colligere ('gather together'), is derived from Latin collectionem (nominative collectio), which means 'a gathering together'.

Thus, words are arranged above,

For more information about collection, click here:

https://brainly.com/question/19053793

#SPJ5

Your colleague has made a suggested change to an important document you are both working
You disagree with their suggested change. They will be reviewing the changes you make before
the final version of the document is submitted to your boss. You both work remotely and are in
radically different time zones. What is the best step to take next?

Answers

Answer:

come to an agreement with your partner on how you can modify or change the suggested change

Explanation:

The best step to take is to set up a virtual meeting between both of you, find out why the reason for the disagreement, and then settle the issues.

What is the virtual meeting about?

Based on the fact that both of you cannot physically meet since both are in different location, the right thing to do is to set up a computer virtual meeting.

Conclusively, the parties involved can trash out issues and misconceptions before submitting to your boss.

Learn more about document from

https://brainly.com/question/16650739

#SPJ2

When using a software budget, you should feel very confident if you choose a solution that looks like it will come in exactly on budget, without any overage costs.

a
True

b
False

Answers

Answer:

probably false

Explanation:

because u dont want a budget to b exact u want it completely covered

The tags are always enclosed within a pair of
(a) curly
(b) square
(©) angular​

Answers

Answer:

(©) angular​

Explanation:

The tags should always be enclosed with a pair of angular brackets

In the case of Hyper text markup language (HTML) the brackets that should be used is angular brackets i.e. (< and >)

So as per the given situation, the option c is correct

And, the rest of the options are incorrect

Therefore the tags that should always enclosed with a angular pairs

Answer:

(©) angular

Explanation:

The tags are always enclosed within a pair of angular.

If you're a beginner to data analysis, what is the first thing you should check when you build data queries?
a. workflow diagrams
b. calculations
c. differentials
d. record counts

Answers

D. Record Counts, trust me I took notes on this and it’s also in my quizlet

help with these 2 questions srry for the horrible pic​

Answers

Answer:

the first one is email address nd the second one is semi-blocked letters ? sorry if im wrong.

Explanation:

Answer:

I cant read

Explanation:

How do most business applications and websites process credit card transactions?

a
They develop in-house credit card apps/services.

b
They license third-party credit card apps/services.

c
They run them through banks owned by the business.

d
They refuse to accept credit cards.

Answers

Answer:

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

Explanation:

Most business applications and websites use and process the credit card for their transaction.

For example, e-commerce website such as ali baba, am a zon, accepting credit card transaction when the customer gets to purchase any product from their stores. Their transactions are processed by in house credit card apps/service. But these apps/services owned by a third party. They just give you API services and related code to integrate the credit card services.  

By using their in-house credit card apps/services, they know that user has transferred the money into their account for the purchased product, upon receiving payment confirmation, they then prepare and dispatch the order.

So, the correct answer to this question is:

To process the credit card transactions, they license third-party credit card apps/services backed by the internet merchant who is responsible for handling and managing the money of the business account.    

What term is the ability to restore service quickly and without lost data if a disaster makes your components unavailable or it destroys data

Answers

Answer:

"Recoverability" is the appropriate solution.

Explanation:

The above refers to either the DBMS work timetables where only certain processes are conducted out only when all transactions where such modifications are learned by the submission are implemented or operated. This technique is used to reinstate make informed even without system failures.


on the surface of a magnetic disk fragmentation occurs when file is stored in non-contigious sectors on the disks surface?

Answers

manyetik disk parçalanması, dosya disk yüzeyinde bitişik olmayan sektörlerde depolandığında meydana gelir.

Derek is creating an animation for his class project. What is the first step Derek should follow while creating the animation?
A. storyboarding
B. preparing a script
C. adding voices to the animation
D. choosing an animation tool

Answers

Answer:

1. Script,2.Storyboarding,3.Choosing a Animation tool, 4. Adding voices to the animation

Explanation:

Script comes first since that you have to follow everything on there, then you have to make a illustration of the storyboard, then it comes to choosing which animation tool is better, and last but definitely not least is adding voices to that animation.

Answer: preparing a script

Explanation:

A business owns a printer but the printer is used for cloud printing purposes. What type of resource is this?

Answers

I’m confused , what are the choices ?

Which statement will read an entire line of input into the following string object?

Select one:
a. cin << address;
b. cin address;
c. getline(cin, address);
d. cin.get(address);
e. None of these

Answers

Answer:

getline(cin, address);

Explanation:

Given

String object: address

Required

Statement that reads the entire line

The list of given options shows that the programming language is c++.

Analysing each option (a) to (e):

a. cin<<address;

The above instruction will read the string object until the first blank space.

Take for instance:

The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.

b. cin address:

This is an incorrect syntax

c. getline(cin,address);

Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address

d. cin.get(address);

address is created as a string object and the above instruction will only work for character pointers (i.e. char*)

From the above analysis, option (c) is correct.

If an element contains text or another element, it is marked using a ______tag set in which an opening tag and a closing tag enclose the element content.

a. single-sided
b. two-sided
c. one-sided
d. double-sided

Answers

Answer:

b. two-sided

Explanation:

If an element contains text or another element, it is marked using a two-sided tag set in which an opening tag and a closing tag enclose the element content.

For example, <p>it is very important to "check" the expiration date of goods before buying them.</p>. In this scenario, the <p> represents the opening tag while the </p> represents the closing tag in HTML programming.

Line installers must complete a four-year university degree program in order to be hired.

True

False

Answers

Answer:

Line installers must complete a four-year university degree program in order to be hired.

Explanation:

true

Yes this fact is true

Assume you are given a boolean variable named isNegative and a 2-dimensional array of ints that has been created and assigned to a2d. Write some statements that assign true to isNegative if more integer elements in entire 2-dimensional array are negative than not.

Answers

Answer:

#include <iostream>

using namespace std;

int main(){

   int rows, cols;

   bool isNegatives;

   cout<<"Rows: ";

   cin>>rows;

   cout<<"Columns: ";

   cin>>cols;

   int a2d[rows][cols];

   for(int i =0;i<rows;i++){

   for(int j =0;j<cols;j++){

       cin>>a2d[i][j];}    }

   int negatives, others = 0;

   for(int i =0;i<rows;i++){

   for(int j =0;j<cols;j++){

       if(a2d[i][j]<0){

           negatives++;}

       else{

           others++;}}    }

   if(negatives>others){

       isNegatives = true;}

   else{

       isNegatives = false;}

   cout<<isNegatives;  

   return 0;

}

Explanation:

For clarity and better understanding of the question, I answered the question from the scratch.

This line declares number of rows and columns

   int rows, cols;

This line declares the Boolean variable

   bool isNegatives;

This line prompts user for rows

   cout<<"Rows: ";

This line gets the number of rows

   cin>>rows;

This line prompts user for columns

   cout<<"Columns: ";

This line gets the number of columns

   cin>>cols;

This line declares the array

   int a2d[rows][cols];

This line gets user input for the array

   for(int i =0;i<rows;i++){

   for(int j =0;j<cols;j++){

       cin>>a2d[i][j];}    }

This line declares and initializes number of negative and others to 0

   int negatives, others = 0;

The following iteration counts the number of negatives and also count the number of non negative (i.e. others)

   for(int i =0;i<rows;i++){

   for(int j =0;j<cols;j++){

       if(a2d[i][j]<0){

           negatives++;}

       else{

           others++;}}    }

This checks of number of negatives is greater than others

   if(negatives>others){

If yes, it assigns true to isNegatives

       isNegatives = true;}

   else{

If otherwise, it assigns false to isNegatives

       isNegatives = false;}

This prints the value of isNegatives

   cout<<isNegatives;  

See attachment

Other Questions
John, a real estate salesperson, has entered into an agency agreement with a client whose scope is limited to that described in the agreement. This level of authority suggests that John is what type of agent When the mallet hits the ball with an action force, the ball exerts a reaction 1 force on the mallet as explained by: 1) Newton's first law 2) Newton's second law 3) Newton's third law 4) all three of Newton's laws Please Help Quick 13 pointsHow many solutions does the following equation have? 3(x + 5) = -4x + 8 A. NO SolutionsB. Exactly one solutionC. Infinitely many solutionsHow many solutions does the following equation have?7(y + 3) = 5y + 8A. No SolutionsB. Exactly one solutionC. Infinitely many solutionsHow many solutions does the following equation have?-15y + 7 + 17y = 2y + 70A.No SolutionsB.Exactly one solutionC.Infinitely many solutionsHow many solutions does the following equation have? -4x - 7 + 10x = -7 + 6xA.No SolutionsB.Exactly one solutionC.Infinitely many solutionsHow many solutions does the following equation have? 4(y - 30) = 4y + 12A.No SolutionsB.Exactly one solutionC.Infinitely many solutionsWhich of the following equations have exactly one solution? Choose all that apply:-19x + 18 = -19x + 1819x - 18 = -19x + 18-19x - 18 = -19x + 1819x + 18 = -19x + 18Which of the following equations have no solution? Choose all that apply:5x + 5 = -4x - 54x + 5 = -4x + 5-4x + 5 = -4x - 5-4x + 5 = -4x - 4Which of the following equations have infinitely many solution? Choose all that apply:-76x + 76 = -76x + 7676x + 76 = 76x + 76-76x + 76 = 76x + 7676x + 76 = -76x + 76Answer with work shownSolve for e: 9e + 4 = -5e + 14 + 13ePlease help and I can't thank you enough True or False?The following relation represent a function.Question 5 options: True False A glass is 47 full. Then 70cm3 of orange juice is poured in.The glass is now 34 full. What is the total volume of the glass? 2)+-12613+5-2-3-97-244)-70++-16-521-10-11-17+12-6+24-22-13915 What materials were used to construct early American homes? Write an expression that uses subtraction and division that has a value of 3. What's the answer to this? Jillian is making accessories for the soccer team. She uses 667.43 inches of fabric on headbands for 27 players and 4 coaches. She also uses 237.87 inches of fabric on wristbands for just the players. How much fabric was used on a headband and wristband for each player? Kung ikaw ay magiging isang punong barangay, paano mo pamamahalaan ang iyong nasasakupan? Find the value of y showing your steps or explaining your thinking. (2 pts.) PLS ANSWER WHOEVER ANSWERS FIRST GETS BRAINLIEST!!!!Shelby bought 6 pounds of hamburger meat to make hamburgerpatties. However, 4 pounds of the hamburger had to be thrown away.How much of the hamburger meat did not get thrown away? write the place value of 1.059 each decimal write a point-slope foem an equation of the line that passes through the given point and has the given slopes (2,-2); m = -5? a. y -2 = -5(x -2) b. y+2 = -5(x +2)c. y -2= -5(x+2)d. y +2= -5(x -2) Which situation can be modeled using a linear function? the population of yeast that doubles after every minute the population of yeast that doubles after every minute the height of a projectile after it is launched the height of a projectile after it is launched the distance covered by a car moving at a constant speed the distance covered by a car moving at a constant speed the cost of a printing machine that depreciates every year at 2% per year Some horses are bred for speed while other horses are bred for pulling heavy loads. What is the main influence on weather a horse will become a racehorse or farm horse? If 12 pounds of apples cost $21.60, how much does each pound cost? PLEASE HELP 20 POINTSwill report if you don't actually answerHow is a percent error like a percent change?Answer in complete sentences. The drug 2,4-dinitrophenol (DNP) destroys the proton gradient across the inner mitochondrial membrane. What would be the effect of incubating isolated mitochondria in a solution of DNP Steam Workshop Downloader