IN C++Write a recursive method insertLast(const ItemType& anEntry) to insert anEntry to the end of the Linked List.We can determine how many digits a positive integer has by repeatedly dividing by 10 (without keeping the remainder) until the number is less than 10, consisting of only 1 digit. We add 1 to this value for each time we divided by 10. Write a recursive function numOfDigits(int n) to return the number of digits of an integer n.

Answers

Answer 1

Answer:

#include <iostream>

#include <cstdlib>

int numOfDigits(int n) {

   if (std::abs(n) <= 9) return 1;

   return 1 + numOfDigits(n / 10);

}

int main()

{

   int a[] = { 0, 1, -24, 3456, 12345 };

   for (int n : a)  

       std::cout << n << " has " << numOfDigits(n) << " digits" << std::endl;

}

Explanation:

This is the answer to your second question.

The first question requires some clarification on how the linked list is defined.


Related Questions

The primary benefit of digital distribution is that more audiences are able to purchase and view a film
True or False?

Answers

Explanation:

The answer could be either-or. At the moment True because people are in quaritine and can't go to movie theaters or go buymovies from a store. It could also be false because not everyone owns a computer or has access to the internet. Also, the number of family houses that have internet are growing.

It all depends on the context I guess. You could say true becuase the number of families with wifi is growing and we're all being quarantined or you could say false because not everyone has access to the internet.

What don’t colleges consider when deciding whether to accept you as a student?

Answers

Awnser: Your skills, compatibilities, grades in highschool, and criminal record would most likely be a helping key for deciding who will be accepted into the college.

(This is a guess, and could completely have been wrong, concluding that I have never been in a college.)

How can templates be made available to other users? your user profile directory a shared network location an intranet SharePoint document library none of the above​

Answers

Answer:

b. a shared network location

Explanation:

A templates can easily be made available to other users through a SHARED NETWORK LOCATION reason been that shared network location allow other computer users on a computer network to easily and quickly access templates, stored files and to share files with one another or from one computer to another computer.

Therefore with SHARED NETWORK LOCATION templates can be made available to other users.

Answer: B

Explanation:

Choose the best collection for each situation.
You need to keep a record of the ages of the last 50 customers visit a restaurant. As new customers come in you delete the age that has been in the list the longest.

You need to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

You write a loop to save anywhere from 10 to 100 values from a user. You will pass the collection to a function to find the average.

Answers

Answer:

Deque: You need to keep a record of the ages of the last 50 customers visit a restaurant. As new customers come in you delete the age that has been in the list the longest.

Tuple: You need to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

List: You write a loop to save anywhere from 10 to 100 values from a user. You will pass the collection to a function to find the average.

Explanation: Just got the results back no thanks to the guy above

The best collection for the situations will be deque, tuple, and list.

A deque refers to the ordered collection of items that is similar to the queue. It has two ends and the items remain in position in the collection.

A tuple refers to the finite ordered sequence of elements. It is a data structure that is used in storing an ordered sequence of values.

Since the last 50 customers visit a restaurant, deque will be utilized. Tuple will be used when one needs to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

Read related link on:

https://brainly.com/question/17483083

What is a central idea for 3 Despite this lack of precision, Galileo had constructed a wonderful invention. Yet, he considered it to be a useless toy and even called it a “little joke.” As far as anyone knows, the famous physicist, mathematician, and astronomer never tried to adapt the thermoscope into a device to measure the temperature of the human body.

Answers

Answer:

Main Idea of Despite this lack of precision, Galileo had constructed a wonderful invention. Yet, he considered it to be a useless toy and even called it a “little joke.” As far as anyone knows, the famous physicist, mathematician, and astronomer never tried to adapt the thermoscope into a device to measure the temperature of the human body.

Explanation:

Jacob has a text file open, and he is typing on the keyboard. What is the best description of how the
changes are being implemented?
The original file is temporarily changed; the changes become permanent when he clicks "save."
The new version is kept in a special virtual space; the file is only changed when he clicks "save."
The information is stored on the clipboard:
O A copy is created with a new filename, which will overwrite the old one when he clicks "save."

Answers

Answer:

The new version is kept in a special virtual space; the file is only changed when he clicks "save."

The new version is kept in a special virtual space; the file is only changed when he clicks "save." this is the best description of how the changes are being implemented. Thus, option B is correct.

What is a keyboard?

Using a keyboard, users can input characters, symbols, and integers into the device. Whenever you write, you hit each key located on the keyboard separately.

As she is changing the files or editing the file she is editing the file and the changes are definitely being made in the same but that does not mean that the whole file is edited and when you open it will be changed.

This process is being done in a virtual space. It will only be secured after she has saved the document on which she is working.

Therefore, option B is the correct option.

Learn more about the keyboard, here:

https://brainly.com/question/14313428

#SPJ2

Illustrator : how do you edit a swatch ?​

Answers

Answer:

To edit an existing pattern, double-click the pattern in the pattern swatch, or select an object containing the pattern and choose Object > Pattern > Edit Pattern

2. Answer true or false.
An alien may become a citizen by birth or wealth.
false
true

Answers

True - because you cant deny somebody who was legally born where you automatically become a citizen if you were born in that place.

Answer:

True

Explanation:

Based on the details in The Riddle of the Rosetta Stone, how did the career of Jean-Baptiste Fourier differ from that of Jacques-Joseph Champollion?

Unlike Champollion, Fourier studied in Paris with Sylvestre de Sacy.
Unlike Champollion, Fourier cared more about non-Egyptian articles.
Unlike Champollion, Fourier studied and learned many languages.
Unlike Champollion, Fourier accompanied Napoleon to Egypt.

Answers

Answer:

D

Explanation:

Answer:

d

Explanation:

JPG is considered a lossy file format. What does this mean?
O JPG files are insecure.
O JPG files compress efficiently but have compromised quality.
O JPG files are easy to delete.
O JPG file compression can be reversed.
PLEASE HELPPPPP!!!!!

Answers

Answer:

either a or b

Explanation:

Answer:

A it files are insecure

Explanation:

Which software programs should students avoid using to create and submit course work? (Choose all that apply).


Word


Pages


Numbers


Keynote

Answers

Keynote, pages, numbers

Write a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the
JOptionPane statement and a System.out statement to output a message inside the loop highlighting a pass
mark >= 50 and <= 100. Any other mark will output a messaging stating it’s a fail.
Example of the expected output is as follows:
55 is a pass
12 is a fail

Answers

Answer:

Written in Java

import javax.swing.JOptionPane;

public class Decision{

public static void main(String[] args) {

    int i = 1;

    while(i<=5){

    String score = JOptionPane.showInputDialog("Input <score>");

    int mark = Integer.parseInt(firstNumber);

    if(mark >= 50 && mark <= 100) {

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

    else{

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

    i++;

    }

}

}

Explanation:

This initializes the a counter variable i to 1

    int i = 1;

The following iteration is repeated as long as i is less than or equal to 5

    while(i<=5){

This prompts user for input

    String score = JOptionPane.showInputDialog("Input <score>");

This converts user input to integer

    int mark = Integer.parseInt(firstNumber);

This checks if input is within 50 and 100 (inclusive)

    if(mark >= 50 && mark <= 100) {

This prints pass

        JOptionPane.showMessageDialog(null, mark, " is a pass", JOptionPane.PLAIN_MESSAGE);

    }

If otherwise

    else{

This prints fail

        JOptionPane.showMessageDialog(null, mark, " is a fail", JOptionPane.PLAIN_MESSAGE);

    }

This increments the counter variable by 1

    i++;

    }

Which of the following types of software applications would open a txt file?
A. Image editor
B. Database
c. Media player
D. Word processor

Answers

Answer:

database or word proccessor

Explanation:

A.

Answer:

Word Processor

Explanation:

A-p-e-x

Effective communication in our relationships with others has several practical functions, including preventing unwanted problems, and strengthening levels of trust, honesty, respect, and morale.

Answers

Answer:

True.

Explanation:

Communication can be defined as a process which typically involves the transfer of information from one person (sender) to another (recipient), through the use of semiotics, symbols and signs that are mutually understood by both parties.

An effective communication can be defined as an act that typically involves conveying or disseminating information efficiently and effectively from an individual (sender) to another (recipient) without any redundancy. Thus, effective communication ensures that messages or information are transmitted properly, guarantees a feedback, lacks the use of harsh tones, ensures both parties are well understood, gives room for clarity etc.

Hence, effective communication in our relationships with others has several practical functions, including preventing unwanted problems, and strengthening levels of trust, honesty, respect, and morale.

A _____ is relatively inexpensive to install and is well-suited to workgroups and users who are not anchored to a specific desk or location.​
A) local area network (LAN)
B) wireless local area network (WLAN)
C) metropolitan area network (MAN)
D) storage area network (SAN)

Answers

Answer:

B) wireless local area network (WLAN)

Explanation:

WLAN which fully meaning is WIRELESS LOCAL AREA NETWORK is a network provider that enables two or more mobile phone user , desktop or computer user to connect and have access to the internet by simply connecting to the local area wireless network and this type of wireless network are more cheaper to install.

Example of where WIRELESS LOCAL AREA NETWORK can be found are : School building, Office building, School campus, home, among others.

Which term refers to testing that your software still works as intended once it is connected to other systems?
a
stress testing
b
regression testing
c
user acceptance testing
d
load testing

Answers

Answer:

c

user acceptance testing

what is the coefficient in 2m³n​

Answers

Answer:

i think it's '2'

Explanation:

cause coeffecient is the numerical factor of a term.

Challenge activity 7.6.1: Constructor overloading.Write a second constructor as indicated. Sample output:User1: Minutes: 0, Messages: 0User2: Minutes: 1000, Messages: 5000#include using namespace std;class PhonePlan{public:PhonePlan();PhonePlan(int numMinutes, int numMessages);void Print() const;private:int freeMinutes;int freeMessages;};

Answers

Answer:

#include

using namespace std;

class PhonePlan{

public:

PhonePlan();

PhonePlan(int numMinutes, int numMessages);

void Print() const;

private:

int freeMinutes;

int freeMessages;

};

PhonePlan::PhonePlan() { // Default constructor

freeMinutes = 0;

freeMessages = 0;

return;

}

PhonePlan::PhonePlan(int numMinutes, int numMessages) {

freeMinutes = numMinutes;

freeMessages = numMessages;

return;

}

void PhonePlan::Print() const {

cout << "Minutes: " << freeMinutes << ", Messages: " << freeMessages << endl;

return;

}

int main() {

PhonePlan user1Plan;

PhonePlan user2Plan(1000, 5000);

cout << "User1: ";

user1Plan.Print();

cout << "User2: ";

user2Plan.Print();

return 0;

}

Explanation:

The C++ source code has a defined class called "PhonePlan" with a default constructor which initializes the phone time and messages of a user to zero and another constructor method which assigns the "numMessages" and "numMinutes" to the user messages and minutes and displays it in the console.

The code that includes a second constructor is coded below.

Source code:

#include <iostream>

using namespace std;

class PhonePlan {

public:

   PhonePlan();

   PhonePlan(int numMinutes, int numMessages);

   void Print() const;

private:

   int freeMinutes;

   int freeMessages;

};

PhonePlan::PhonePlan() {

   freeMinutes = 0;

   freeMessages = 0;

}

PhonePlan::PhonePlan(int numMinutes, int numMessages) {

   freeMinutes = numMinutes;

   freeMessages = numMessages;

}

void PhonePlan::Print() const {

   cout << "Minutes: " << freeMinutes << ", Messages: " << freeMessages << endl;

}

int main() {

   PhonePlan user1;

   PhonePlan user2(1000, 5000);

   cout << "User1: ";

   user1.Print();

   cout << "User2: ";

   user2.Print();

   return 0;

}

In this code, the `PhonePlan` class has two constructors.

The first constructor `PhonePlan()` is the default constructor that sets `freeMinutes` and `freeMessages` to 0.

The second constructor `PhonePlan(int numMinutes, int numMessages)` is an overloaded constructor that takes two parameters `numMinutes` and `numMessages`. It assigns the provided values to `freeMinutes` and `freeMessages`.

The `Print()` function is used to display the values of `freeMinutes` and `freeMessages` for each `PhonePlan` object.

In the `main()` function, we create two `PhonePlan` objects: `user1` using the default constructor and `user2` using the overloaded constructor with values 1000 and 5000 for minutes and messages, respectively. We then call the `Print()` function for each object to display the minutes and messages for each user.

Sample Output:

User1: Minutes: 0, Messages: 0

User2: Minutes: 1000, Messages: 5000

In the output, `user1` has 0 minutes and 0 messages, while `user2` has 1000 minutes and 5000 messages, as initialized by the overloaded constructor.

Learn more about Constructor overloading here:

https://brainly.com/question/13267120

#SPJ4

What should you do if you do not understand the directions on a test?

Answers

Answer:

ask your teacher for a little guidence.

Explanation:

even though you may not get the answer you need they might give you some assitance

Select one among the the main categories of computer software, which one is not a category
of Computer software? (1 mark) US
Application
Programs
Utilities
Systems​

Answers

Answer:

utilities

Explanation:

the other 3 are Cs programs

Zoe has been asked to identify the external links that exist in a workbook that has primarily been managed by
another employee.
Which feature should she use?

Answers

Answer:

Data tab and external links group.

Explanation:

I'm not 100% sure but it makes the most sense

Answer:data tab and external links group

Explanation:

please I need help.
Select the correct answer. of the four email features listed below, which is the most important?
O A. the To address
O B. the Bcc address
OC. the attachments
O D. the domain name

Answers

Answer:

The answer is the "TO address"

Explanation:

i just took the test and got it right sooooooo

Answer: A “The To adress”

Explanation:

got it right

For Questions 1-4, consider the following code: def mystery1(x): return x + 2 def mystery2(a, b = 7): return a + b #MAIN n = int(input("Enter a number:")) ans = mystery1(n) * 2 + mystery2 (n * 3) print(ans)
What is the output when the user enters -4?
What is the output when the user enters 3?
What is the output when the user enters -2?
What is the output when the user enters 9?

Answers

Answer:

What is the output when the user enters -4?

-9

What is the output when the user enters 3?

26

What is the output when the user enters -2?

1

What is the output when the user enters 9?

56

Explanation: Just did it and got all correct. Hope it helps!!

Matt creates a Java class as part of his college assignment. He wants this class to be accessible within the current package only. Which access specifier should Matt use?

Matt has another Java assignment with multiple classes. In this assignment, there is a general class. A few subclasses outside the package use methods from this general class. Which access specifier should Matt use for the general class?

Matt should use the (blank) access specifier for the first class.

A. Protected
B. Default
C. Private
D. Public

He should use the (blank) access specifier for the general class.

A. Protected
B. Public
C. Default
D. Private

Answers

Answer:

first use Default as

a class with the default access modifier in a package, only those classes that are in this package can access this class. No other class outside this package can access this class.

general uses protected to make itself accecible to the subclasses.

It is a science fiction but the answer is not science fiction.it States ;it's inventiveness,uncertainly and futuristic ideas typically deal with science and technology. What's the answer? Kindly give me feedback

Answers

Answer:

The uncertainty of inventiveness and futuristic ideas usually deal with science and technology.

Inventibility is something uncertain which promotes a risk in any system in which it is inserted. With that, we can naturally associate it with the maintenance of science and technology, because both are in need of inventing new creations, which may or may not be effective for the defeat of uncertainties and the creation of certainties.

This is usually linked to futuristic ideas, which may not fit in today's society, but which impose improvements, or not, for societies in the future. Leading to the creation of more technologies and more sciences.

Write a program that uses a scanner to report some statistics about words in an input sentence ( see Section 7.8). The outputs should be the number of words in the sentence, the average word length, and the length of the sentence.

Answers

import java.util.Scanner;

public class JavaApplication77 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = scan.nextLine();

       String [] arr = new String[sentence.length()];

       arr = sentence.split(" ");

       System.out.println("There are "+arr.length+" words in the sentence.");

       int count = 0;

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

           count += arr[i].length();

       }

       System.out.println("The average length of a word in your sentence is "+(count/arr.length)+" characters");

       count = 0;

       System.out.println("Your sentence is "+sentence.length()+" characters long.");

       

   }

   

}

For the length of a sentence, I included spaces as characters but I did not do this for the length of a word. I hope this helps!

A company decides to design and produce a new type of ice skate. Which of the following should the company do first?

Answers

What is the options

Since the company have decided to design and produce a new type of ice skate, the company need to test the design of their new skates.

The testing of the skates design is necessary to know how safe or efficient, the skates will be when produced.

In conclusion, because the company have decided to design and produce a new type of ice skate, the company need to test the design of their new skates.

Read more about product design

brainly.com/question/25886641

which is the best video games​

Answers

Answer:

overwatch and dead by daylight

Answer:

GTA V and COD

Explanation:

PLZ! What is an example of a current board game that involves moving pieces around and taking risks? 10 POINTS!

Answers

Answer:

Easy, Risk

Explanation:

a current board game that involves moving prices around and taking risks would be, chess

A typical computer user will never come across most of the computer's files; the majority of files on a
computer are only relevant to the computer itself or a developer.
True
O False

Answers

Answer:

True

Explanation:

Answer:

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

Explanation:

The answer to this question is True. As you know that a typical computer user doesn't use most of the computer's files, because the majority of the computer's files on the computer are only relevant to the computer itself or a developer.

For example, a typical computer user can use internet explorer to search for something online on the internet. He/she can't come across to change the firewall, inbound and outbound net setting, etc. For example, A typical user will not use IIS and comes across its related files but a developer who is developing the web application can use and change setting in IIS.

A typical user can not change the environment variable but the developer can change the environment variable and computer registry setting.

Also a typical user does not change the windows setting and come across all files related to windows setting but developer can change.

Other Questions
MMM HEY PLEASE HELP. IM LITERALLY ABOUT TO END MYSELF. The lithosphere contains rocks, soils, and minerals. Strengths of the Articles ofConfederationI need as many as you can think of!!!! help me pls pls pls what is 40% of 50?. please please help me!! what is y equals 5 times x equal Select the word with the most appropriate connotation to complete each sentence.4. The dog was so that you couldnt resist petting her.(attractive, adorable, handsome)5. Dana dialed in the combination, turned the key, and gave the door a shove, and then the safe opened. (weak, feeble, firm) How many Languages can you speak? Which of the following is NOT true about Mayflower passenger Richard Warrena) Had the following children: Mary, Ann, Sarah, Elizabeth, Abigail, Nathaniel and Josephb) He received his acres in the Division of Land in 1623, and his family shared in the 1627 Division of Cattle.C Richard Warren's descendants include such notables as Civil War general and President Ulysses S. Grant; President Franklin D. Roosevelt; and Alan B. Shepard, Jr. the first American in space and the fifth person to walk on the moon.d) He died in 1687 at the age of 89, one of the last surviving Mayflower passengers. Which subregion in the eastern United States has hot, humid summers and mild winters?1) midwest2) southeast3) new England4)mid alantic Its 10:00 according to the Khan academy Simplify completely ASAPP Which of the following compounds has the lowest vapor pressure at 25C?a.CH3CH2CH3b.CH3OCH3c.CH3OHCH2OHd.CH3CH2CH2Cle.CH3CH2CH2CH3 The Canadian lynx is a large wild cat that lives in the cold regions of Canada. The snowshoe hare is the main prey species that is hunted by the Canadian lynx. The snowshoe hare eats grass, fern, and leaves. If the population of Canadian lynx were to completely disappear, what would most likely happen to the food supply of the snowshoe hare? *A. The snowshoe hare would stop eating grass, so there would be less food available.B. The snowshoe hare would start eating each other, so the food supply would not be affected.C. The population of snowshoe hare would outgrow the food supply, so there would be less food available.D. The population of snowshoe hare would decrease, and there would be more food available. If you could propose an amendment to the U.S. Constitution, what would it be? Make your proposal in the space below. Clearly explain why you think this amendment should be made, including the grievance it will address. If the terminal side of an angle falls in quadrant IV, then the secant value is? zero positive negative I need two more branliest :(( !!! Pls help me !! Commission type income is very consistent from month to month.TrueFalse which statement best completes the diagram