Programming: Write a recursive function to_number that forms the integer sum of all digit characters in a string. For example, the result of to_number("3ac4") would be 7. Hint: If next is a digit character ('0' through '9'), function is_digit(next) in header will return true.

Answers

Answer 1

yes

Explanation:

isn't really noted but if the sequence is in the given order the ("3at4") could be expressed in a ('0' to '9' )format


Related Questions

Find the second largest and second smallest element in a given array. You can hardcode/declare the array in your program.

Answers

Answer:

Program for Second largest in an array:-

#include <bits/stdc++.h>

using namespace std;

int main()

{

    int f,s,n; //declaring 3 variables f for first largest s for second largest n is size.

    cin>>n;//taking input size of the array.

    if(n<2)//n should be greater than 2..

    cout<<"n should be greater than 2"<<endl;

    int a[n];// array of size n.

    for(int i=0;i<n;i++)

    {

        cin>>a[i];

    }

   f = s = INT_MIN;//initialising f and  s with minimum value possible.

   for (int i =0; i <n;i ++)  

   {  

       if (a[i] > f)  

       {  

           s = f;  

           f = a[i];  

       }  

       else if (a[i] > s && a[i] != f)  

           s = a[i];  

   }  

   if (s == INT_MIN)  

       cout<<"No second largest exists"<<endl;

   else

       cout<<"Second largest element is :"<<s;

       return 0;

}

Program for second smallest element is:-

#include <bits/stdc++.h>  

using namespace std;  

int main()  

{  

int f,s,n; //declaring 3 variables f for first smallest s for second smallest n is size.  

cin>>n;//taking input size of the array.  

if(n<2)//n should be greater than 2..  

cout<<"n should be greater than 2"<<endl;  

int a[n];// array of size n.  

for(int i=0;i<n;i++)  

{  

cin>>a[i];  

}  

f = s = INT_MAX;//initializing f and s with maximum value possible.  

for (int i =0; i <n;i ++)  

{  

if (a[i]<f)  

{  

s = f;  

f = a[i];  

}  

else if (a[i] < s && a[i] != f)  

s = a[i];  

}  

if (s == INT_MAX)  

cout<<"No second smallest exists"<<endl;  

else  

cout<<s;//it is the second smallest element...  

return 0;  

}

Explanation:

For Second largest:-

1. Declare 3 variables f, s and n. where n is size the array f is first largest and s is second largest.

2. Initialize f and s with minimum value possible.

3. Iterate over the array a and do the following steps:-

   1.If element at ith position is greater than f. Then update f and s.

   s=f and f=a[i].

   2.If the element is between s and f then update s as.

   s=a[i].

4. Print s because it is the second largest in the array.

For Second smallest:-

1. Declare 3 variables f, s and n. where n is size the array f is first smallest and s is second smallest.

2. Initialize f and s with minimum value possible.

3. Iterate over the array a and do the following steps:-

   1.If element at ith position is smaller than f. Then update f and s.

   s=f and f=a[i].

   2.If the element is between s and f then update s as.  

   s=a[i].  

4. Print s because it is the second smallest in the array.

What is the difference between an argument and a parameter variable?

Answers

Answer:

The value enter in the function calling is called argument. Argument passed to function.

The variable declare in the function to capture the pass value from the calling function is called parameters.  

Explanation:

Argument is used in the calling function and parameter is used in the defining the function.

for example:

//create the function

int count(parameter_1, parameter_2,.....)

{

  statement;

}

count(argument_1. argument_1,.....);   //call the function

. If you executean infinite recursive function on a computer it will executeforever.
a. True
b.False

Answers

Answer:

b. False

Explanation:

If you execute an infinite recursive function on a computer it will NOT execute forever.

All of the followingshould be followed by entrepreneur for being effective

leader,EXCEPT:

a. Show respect foremployees

b. Show concern foremployees’ welfare

c. Try to do everythinghimself

d. Encourage and praiseothers

Answers

Answer:

C - Try to do everything himself

Explanation:

It is usually never advisable for an entrepreneur to attempt to do everything themselves. Delegation (assigning a task to a subordinate) is an important aspect of entrepreneurial leadership, this benefits the entreprenuer himself and allows his employees to feel a sense of confidence because they were trusted witht the task and it is a chance to show what they are capable of.

Given an array of integers an). The array is already NOT write C++ statements to fill the array eye write C++ statements that print to the screen how many values in the how many values are odd. In addition, the statements output to the scre the array that are even. s

Answers

Answer:

#include<iostream>

using namespace std;

int main () {

   int n;

   int odd=0,even=0;

  cout<<"Enter the number of element store in the array: ";

  cin>>n;

  int arr[n];

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

     cin>>arr[i];

  }

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

       if(arr[i]%2==1){

           odd++;

       }else{

           even++;

       }

  }

  cout<<"The number of odd values is: "<<odd<<endl;

  cout<<"The number of even values is: "<<even<<endl;

}

Explanation:

Include the library iostream for input/output.

Create the main function and declare the variables.

Then, print the message on the screen and store the value enter by the user for the size of the array. After that, take a for loop and store the values in the array enter by the user.

then, take a for loop for traversing to the array and check the condition for odd and even by using if-else statement.

for odd: If odd values divided by 2 it gives 1 remainder.

for even: If even values divided by 2 it gives zero remainder.

if condition true, then update the counter.

finally, print the result.

What are the light sources offiber optics?

Answers

Answer:

Light sources of fiber optics are used to inject light into a fiber optic cable. There are two varieties of light sources: laser diodes and light emitting diodes (LEDs) . They’re further differentiated by the wavelength and the type of cable.

LEDs are economical, slow in speed, easy to handle, multi mode-only, and have a wide output pattern.

Laser diodes are of expensive and faster than LED's, allow single-mode or multi mode both , and have a narrow output pattern.

The relational database model was created by E.F. Codd.

A.

True

B.

False

Answers

The answer is A. True

Explanation:
E. F Codd, invented he model in the year 1970.

What is stand-alone LDAP server?

Answers

Answer:

A stand-alone LDAP server is defined as to remove the load from a server that does multi function tasks. It is more efficient when we use one or more LDAP configurations .

Light weight Directory Access Protocol (LDAP) is a client and server protocol used for accessing directory data. It  helps in reading and editing the directories over IP networks and runs directly over Transmission control protocol and internet protocol used simple string format for transferring of data.

Write a program in which you input three numbers they canhave decimals so float values and the program gives you the minvalue out of the three. Please need asap thank you

Answers

Answer:

Following is the c++ code:-

#include <bits/stdc++.h>

using namespace std;

int main() {

   float a,b,c;//declaring three float variables..

   cout<<"enter values"<<endl;

   cin>>a>>b>>c;//taking input..

   float mi=min(a,b);//finding minimum in a and b..

   mi=min(mi,c);// finding minimum from mi and c.

   cout<<mi<<endl;//printing the answer.

return 0;

}

Explanation:

I have taken three float variables to hold the values.

then I am finding the minimum in a and b and storing it in mi.

Then finding minimum from mi and c so we will get our final minimum number.

In Java a sub class of a/an______ can override a method of itssuper class and declare it ___________ . In that case the subclassmust be declared abstract.
Abstract class, non abstract class
non abstract class, abstract
non abstract class , reference data type
overloaded class, private

Answers

Answer:

non abstract class,abstract

Explanation:

In java a sub class of a concrete class or non abstract class can override a method of its upper class  and declare it abstract . This is because it does not happen very often, but it is useful when the implementation of  the method in the upper class is not valid in the  subclass .

True / False
The architecture of a computer determines its machine language.

Answers

Answer: True

Explanation:

The architecture of the computer determine the processor and it determines whether we will have fixed length instructions or variable length instructions.

We have CISC and RISC architectures which uses different types of instructions and the data are processes in different machine languages.

The purpose of a database is to help people stop using spreadsheets.

Answers

Answer:

Yes, the purpose of a database in a way is to stop people from using spreadsheets but, it is also so much more.

Explanation:

Databases are a vastly improved form of a spreadsheet. They allow Computer Scientists to automatize a company's information. Giving them the ability to instantly add, retrieve, and modify specific information within a database of hundreds or even thousands of entries. All this with little or no human input. Thus saving a company time and money as opposed to using a regular spreadsheet which requires manual input from an employee.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

After inserting (or deleting) a node from an AVL tree, the resulting binary tree does not have to be an AVL tree.

True

False

Answers

True,After inserting (or deleting) a node from an AVL tree, the resulting binary tree does not have to be an AVL tree.

After inserting or deleting a node from an AVL tree, the resulting binary tree does not necessarily have to be an AVL tree. Here's a detailed explanation:

An AVL tree is a self-balancing binary search tree where the heights of the two child subtrees of any node differ by at most one. When performing operations such as insertion or deletion in an AVL tree, it is crucial to maintain this balancing property to ensure that the tree remains an AVL tree.

However, during the process of insertion or deletion, the balance factor of nodes may become violated, causing the tree to lose its balance. This imbalance can occur due to various factors such as rotations, double rotations, or node restructuring.

In some cases, after inserting or deleting a node, the resulting binary tree may still satisfy the AVL tree property without requiring any additional adjustments. In these cases, the tree remains an AVL tree.

However, there are scenarios where the resulting tree violates the AVL property and becomes unbalanced. In such cases, it is necessary to perform rebalancing operations to restore the AVL property. These operations typically involve rotations or restructuring of nodes to ensure that the heights of the subtrees remain balanced.

Therefore, it is true that after inserting or deleting a node from an AVL tree, the resulting binary tree does not have to be an AVL tree. Maintaining the AVL property may require additional adjustments to restore balance, making it possible for the resulting tree to deviate from the AVL tree structure initially.

Write a program to print out the digits of a number in English. For example, if the number is 153, the output should be “One Five Three.” This program should allow users to input the number by using keyboard

Answers

Answer:

#include <bits/stdc++.h>

using namespace std;

string value(int i)//function return the string of the integer..

{

  if(i==0)

  return "Zero";

  if(i==1)

  return "One";

  if(i==2)

  return "Two";

  if(i==3)

  return "Three";

  if(i==4)

  return "Four";

  if(i==5)

  return "Five";

  if(i==6)

  return "Six";

  if(i==7)

  return "Seven";

  if(i==8)

  return "Eight";

  if(i==9)

  return "Nine";

}

int main() {

int n,a[100],c=0;

cout<<"Enter the integer"<<endl;

cin>>n;//taking input of n..

while(n>0)//storing the integer in the array in reverse order..

{

    int digit=n%10;

    a[c++]=digit;

    n/=10;

}

int s=0,e=c-1;

while(s<=e)//reversing the array.

{

    int temp=a[s];

    a[s]=a[e];

    a[e]=temp;

    s++;

    e--;

}

for(int i=0;i<c;i++)//printing the string according to the number..

{

    cout<<value(a[i])<<" ";

}

cout<<endl;

return 0;

}

Output:-

Enter the integer

230

Two Three Zero

Explanation:

I have created a function which returns string according to the integer.So i have taken an array to store the digits of the number and reversing it so the number is stored as it is in the array.Then printing the numbers accordingly.

Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The user should be asked if he or she wishes to per- form the operation again. If so, the loop should repeat; otherwise it should terminate.

Answers

The do-while loop for the given problem is shown below.  

do  

{  

  // user asked to enter two numbers  

  cout<<"Enter two numbers to be added."<<endl;  

  cin>>num1;  

  cin>>num2;  

  sum = num1 + num2;  

 

  // sum of the numbers is displayed  

  cout<<"Sum of the two numbers is "<<sum<<endl;  

  // user asked whether to perform the operation again  

  cout<<"Do you wish to continue (y/n) ?"<<endl;  

   cin>>choice;  

}while(choice != 'n');  

The variables to hold the two numbers and their sum are declared as float so that the program should work well for both integers and floating numbers.

float num1, num2, sum;

The char variable is taken since it holds only a single-character input from the user, 'y' or 'n'.

char choice;

The whole program is given below.

#include <iostream>

using namespace std;

int main() {

float num1, num2, sum;

char choice;  

do  

{  

  // user asked to enter two numbers  

  cout<<"Enter two numbers to be added."<<endl;  

  cin>>num1;  

  cin>>num2;  

  sum = num1 + num2;  

  // sum of the numbers is displayed  

  cout<<"Sum of the two numbers is "<<sum<<endl;  

  // user asked whether to perform the operation again  

  cout<<"Do you wish to continue (y/n) ?"<<endl;  

  cin>>choice;  

}while(choice != 'n');

cout<<"Quitting..."<<endl;

}

How do you return a value from a function?

Answers

Answer:

return instruction used to return a value from a function.

Explanation:

Function is a block of statement which perform the special task.

Syntax for define a function:

type name(parameter_1, parameter_2,...)

{

  statement;

return variable;

}

In the syntax, type define the return type of the function. It can be int, float, double and also array as well. Function can return the array as well.

return is the instruction which is used to return the value or can use as a termination of function.

For return the value, we can use variable name which store the value or use direct value.

Some misconceptionsabout communication are:

o Communication solves all problems.

o Communication physically breaks down.

o The meaning we attach to a word will be themeaning everyone else attaches to

the word.

o All of the given options

Answers

Answer:

All of the given options

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

Communication is an insanely important and useful, but there are a lot of misconceptions about communication. Based on the answers given in the question, the correct answer would be "All of the Given Options"

Communication can solve many problems but the statement that it can solve all problems is not completely accurate. Whether communication can solve a specific problem depends varies from person to person.

Communication can physically break down since not everyone speaks the same language not everyone can understand each other. Also another physical way is that certain dialogue choices can lead to physical confrontation.

Lastly, the meaning of a word can mean different things to different people. For example, "Happiness" every single person has a unique definition of happiness while others simply say it doesn't exist.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

What will the following C code print out?

int x = 7, y = 5;

if (x > 5)

if (y > 5)

printf(“x and y are > 5”);

else

printf(“x is <=5”);
a) “x and y are > 5”

b) “x is <=5”

c) nothing will be printed

Answers

Answer:

x is <=5

Explanation:

If-else is the statement that is used to execute the statement when the condition is true.

syntax:

if(condition){

    statement;

}else{

    statement;

}  

if we do not provide the curly bracket, still the statement is valid.

in the question, x =7 and y=5

then, check the condition 7 > 5 condition true. it moves to the next if statement and check 5 > 5, condition false. Then it moves to the else part and executes the statement.

and print the output "x and y are > 5".

when organizations request for bids for contracts on their own website procurement, such business is classified as an

A. sell-side marketplace

B. none of these

C. buy-side marketplace

D. electronic exchange

Answers

Answer:

When organizations request for bids for contracts on their own website procurement, such business is classified as an sell-side marketplace -A.

When organizations request for bids for contracts on their own website procurement, such business is classified as an sell-side marketplace sell-side marketplace.

A is the smallest unit of application data recognized bysystem software.

1 Row

2 Field

3 Record

4 Table

Answers

Answer:

A FIELD is recognized as the smallest unit of application data by system software.

Explanation:

Field is recognized as the smallest unit of application data by any system software. The data in relational data base management system ( RDBMS ) is stored as rows also called as database records or simply records. Each record is a row in database and each record contains fields. Columns in data base are nothing but the fields of all the records. They types of fields are fixed length and variable length.

What is the difference between“Internetwork and the Internet”?

Answers

Answer: Inter-network-It is the network that gets created joining of many networks together and form a individual large network .

Internet- it is the global network that contains that contains the collection of all the networks.

Explanation:

Internet is the network at a global level which has the access to connect the various computer network together and inter-network is the network having the combination of many network together to form a single unit of network  .Internet usually forms the connection using routers , servers etc and inter-network uses LAN's ,PAN's etc. to form the connection

__________ is a mathematical model of a real system in the form of a computer program.
(A) Transmitter
(B) Spreadsheet
(C) Simulation
(D) Modulation

Answers

Simulation is a mathematical model of a real system in the form of a computer program.

Answer is Simulation- (C)

Answer:

The correct answer is letter "C": Simulation.

Explanation:

A computer simulation is an algorithm, computer software or a network of servers that have the goal of creating a simulation of an abstract model of a given system. The model is made up of equations that replicate the functional relationships that the real system could have.

This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.



1. do-while

2. while

3. for

4. infinite

5. None of these

Answers

Answer:

This loop is a good choice when you know how many times you want the loop to iterate in advance of entering the loop.: for - 3.

Infinite means not stop. Something that keeps going and going! So the answer would have to be 4 :)

Under Rule 504 ofRegulation D, a company can sell up to ______ of securitiesin

any 12-monthperiod.

a. $50,000

b. $100,000

c. $500,000

d. $1,000,000

Answers

Answer:

5,000,000 (5 million) of securities in any 12-month period.

Explanation:

Based on my extensive research on regulations. Rule 504 of Regulation D provides an exemption for having to register under the federal securities laws. This is usually for companies that are in business with products or services that are considered as securities or commodities. This Rule allows a company to sell up to 5,000,000 of securities in any 12-month period.

This answer is not part of the list of available answers but it is correct. Those answers may be outdated.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

What applications work best with multiplexing?Why?

Answers

Answer:

Multiplexing is the process of combining multiple analog and digital signal into one signal over a shared medium and it is most efficient service, which is provided by the transport layer protocol. The main purpose of multiplexing is that signal are transmitted efficiently.

It contains applications as:

Client-server Application

Many to single client-server application

Many to many client-server application

Many client to many server application is the best because it is improving server application and processing a client request within a group on any server.

What is the most popular service that was supported by almost every early computer networks? In your opinion, what’s the reason for that service to be most popular?

Answers

Answer:

The most popular service supported by every early computer networks:-

Telnet

SMTP(Simple Mail Transfer Protocol)

Reason are as following:-

Telnet:-

When there the number of internet using  people was very less They used to get connected with LAN and Telnet.

It was very useful for bidirectional interactive text oriented communication.  

SMTP:-

SMTP(Simple Mail Transfer Protocol) introduced in 1982 and was one of the most used protocol for e-mails.

It is still used extensively and  It was used for very long time to send and receive email messages for a very long time.

Hence, these are the computer network protocols that are being used as the popular devices.

Which of the following is used to verify a user's identity? A) Identification B) Authentication C) Validation D) Authorisation E) Accountability

Answers

Answer:

A? "A means of proving a person identity"

Explanation:

what impact did the technical standard have on software development?

Answers

Answer:

The technical standard had a huge impact on the world of software development.

Explanation:

In the world of software development and coding in general, every coder has a specific style. Which can cause confusion when working with other coders, which in term causes errors. The Technical Standard allows Everyone to communicate with one another in a way that everyone will understand. Thus allowing for smoother development and less errors.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

In a ____ queue, customers or jobs with higher priorities are pushed to the front of the queue.

A.
structured

B.
divided

C.
priority

Answers

Answer: In a priority queue, customers or jobs with higher priorities are pushed to the front of the queue.

Explanation:

A queue is an abstract data type which is an ordered set of elements. The elements are served in the order in which they join the queue. The first element which was put in the queue is processed first.  

The operations performed on queue data type are dequeue and enqueue.

Dequeue refers to removal of the first element from the queue after it has been serviced.

Enqueue refers to the arrival of new element when the element is added at the end of the queue.

A priority queue is another implementation of a queue. All the elements in a priority queue are assigned a priority. The element with the higher priority is served before the element with a lower priority. In situations of elements having same priority, the element is served based on the order in which the element joined the queue.

In programming, a priority queue can be implemented using heaps or an unordered array. Unordered array is used based on the mandatory operations which are performed on the priority queue.

The mandatory operations supported by a priority queue are is_empty, insert_with_priority and pull_highest_priority_element. These operations are implemented as functions in programming.

The is_empty confirms if the queue is empty and has no elements.

The insert_with_priority puts the new element at the appropriate position in the queue based on its priority. If the priority of the element is similar to the priority of other element, the position of the new element is decided based on the order of joining the queue.

The pull_highest_priority_element pulls the element having the highest priority so that it can be served before other elements. The element having the highest priority is typically the first element in the priority queue.

In operating system, priority queue is implemented to carry out the jobs and/or tasks based on their priority.

how to write a function "void funct()" which will accept a string from the user as input and will then display the string backward.

Answers

Answer:

#include <bits/stdc++.h>

using namespace std;

void funct(){

   string name;

   cout<<"enter the string: ";

   cin>>name;

   

    reverse(name.begin(), name.end());

    cout<<"The string is : "<<name<<endl;

   

}

int main()

{

   funct();

 

  return 0;

}

Explanation:

create the function funct() with return type void and declare the variable type string and print a message for asking to used enter the string.  

The string enter by user is store in the variable using cin instruction.

after that, we use a inbuilt function reverse() which takes two argument.

firs argument tell the starting point and second index tell the ending point. then, the reverse function reverse the string.

name.begin() it is a function which return the pointer of first character of string.

name.end()  it is a function which return the pointer of last character of the string.

finally, print the reverse string.

for calling the function, we have to create the main function and then call the function.

Other Questions
For which rational expression is -5 an excluded value of x? Is there any advantage of usingbranch predictor in a pipleline. Explain with example. choose the equation that represents a line that passes through points -3,2 and 2,15x+y=-135x-y=17x-5y=-13x+5y=7 Narrow opening caused by the separation of rocks A square, single-turn coil 0.132 m on a side is placed with its plane perpendicular to a constant magnetic field. An emf of 27.1 mV is induced in the winding while the area of the coil decreases at a rate of 0.0785 m2 /s. What is the magnitude of the magnetic field? Answer in units of T. Which type of supporting detail does the underlined sentence contain?The hottest part of the sun is called the core. The core is at the center of the sun and is surrounded by the atmosphere. The coremakes up about one-tenth the diameter of the sun, but it is the region where the sun's energy is generated. The temperature inthe core may be as high as 15,000,000C. The sun's energy is produced by nuclear fusion, a reaction in which small quantitiesof matter are converted to energy.A. factB. exampleC. statistic All but 1/13 of the students enrolled at a particular elementary school participated in "Family Fun Night" activities. If a total of 396 students were involved in the evening's activities, how many students attend the school? An electron is released from rest at the negative plate of a parallel plate capacitor and accelerates to the positive plate (see the drawing). The plates are separated by a distance of 1.5 cm, and the electric field within the capacitor has a magnitude of 2.5 x 106 V/m. What is the kinetic energy of the electron just as it reaches the positive plate? ___________ represents the degree to which members of the society accept a hierarchical or unequal distribution of power in organizations and society and reflects on the relationship between superiors and subordinates. In which sentence is the word camping a gerund? My family and I enjoy camping. We noticed the camping club had set up their tents nearby. Last summer, we were camping at the base of a waterfall. I really need help with this I dont understand In this type of inhibition, the inhibitor can bind to the enzyme regardless of whether the substrate has already bound to the enzyme or not. b) noncompetitive c) uncompetitive d) All of the above a) competitive e) None of the above (1.)Find the slope of the line that passes through the given pair of points. (If an answer is undefined, enter UNDEFINED.) (?a + 3, b ? 3) and (a + 3, ?b) *******(2.)If the line passing through the points (a, 1) and (6, 5) is parallel to the line passing through the points (2, 7) and (a + 2, 1), what is the value of a? Question 31 pts8 men and 6 women apply for a job at a new startup. How manyways can 4 of the applicants be selected for a second interview? Find X. Round to the nearest tenth if necessary. At the beginning of an experiment, the concentration of nitrogen dioxide in a reaction vessel was 0.1103 mol/L. After 65.0 s, the concentration decreased to 0.1076 mol/L. What is the average rate of decomposition of NO2 during this time interval, in mol/(L s)? The pressure of 4.20 L of an ideal gas in a flexible container is decreased to one-third of its original pressure, and its absolute temperature is decreased by one-half. What is the final volume of the gas? Write the equation for the hyperbola with foci (12, 6), (6, 6) and vertices (10, 6), (4, 6). The Israelites believed in _____.Select the best answer from the choices provided.A. one god B. two gods C. many gods D. no gods brianna is graphing the function f(x)=x^2+6x+5. what x intercepts should brianna use to graph f(x)