Explain what the problems with the implementation of the function are, and show a way to fix them.// return true if two C strings are equalbool match(const char str1[], const char str2[]){bool result = true;while (str1 != 0 && str2 != 0) // zero bytes at ends{if (str1 != str2) // compare corresponding characters{result = false;break;}str1++; // advance to the next characterstr2++;}if (result) {result = (str1 == str2); // both ended at same time?}return( result );}int main(){char a[10] = "pointy";char b[10] = "pointless";if (match(a,b)){cout << "They're the same!" << endl;}}

Answers

Answer 1

Answer:

The code is not dereferencing the pointers. You have to place an asterisk in front of the pointer to read the value the pointer points to.

Explanation:

So "if (str1 != str2)" must be "if (*str1 != *str2)".

likewise:

   while (*str1 != 0 && *str2 != 0)

and

     result = (*str1 == *str2);


Related Questions

List 2 end to end test commands.

Will mark Brainliest!!

Answers

Answer:

ibm pll

Explanation:

What most defines a community in the digital age?

Answers

The information age of people texting talking on a cellular device and browising the internet

Sum-of-minterms form is a _____. a. compact function notation that represents each literal by a number b. product term having exactly one literal for every function variable c. variable appearance in an expression in true or complemented form d. canonical form of a Boolean equation where the right-side expression is a sum-of-products

Answers

Answer: D. canonical form of a Boolean equation where the right-side expression is a sum-of-products

Explanation:

Sum-of-minterms form is refered to as the canonical form of a Boolean equation such that the right-side expression is the sum-of-products.

It should be noted that the minterms whose sum helps in defining the Boolean function will be the ones that give the 1's with regards to the functions in the truth table.

General purpose application include all the following except

Answers

Answer: Web authoring

Explanation:

Here's the complete question:

General-purpose applications include all of the following except:

Select one:

a. web authoring

b. word processors

c. spreadsheets

d. database management systems

General purpose application refers to the application which can be used for different tasks. Examples of General purpose application are Spreadsheet, Word processors, Presentation software, Database management system etc.

The general purpose applications are quite different from the specialized application which focuses on a particular discipline. Therefore, the option that isn't a general purpose application is the web authoring.

General-purpose applications include all of the following except: web authoring. therefore option A is correct.

General-purpose applications are versatile software programs that can perform various tasks across different domains.

Word processors, spreadsheets, and database management systems are examples of general-purpose applications.

Word processors allow for creating and editing documents, spreadsheets help with organizing and analyzing data, and database management systems handle storing and managing data.

However, web authoring is not a general-purpose application. It is a specialized application focused on creating and designing websites. While it may have some general functionality, its primary purpose is specific to web development.

Therefore, the correct answer is "a. web authoring" as it is not considered a general-purpose application.

Know more about web authoring:

https://brainly.com/question/33531237

#SPJ6

Your question is incomplete, but most probably your full question was,

General-purpose applications include all of the following except:

Select one:

a. web authoring

b. word processors

c. spreadsheets

d. database management systems

what are three limitations of computer?​

Answers

Answer:

Explanation:

Three limittaions of computer are:

It requires reqular power supply to operate .

It needs instructions to perform a task.

It cannot memorize and recall.

Identify congruent triangles. Justify why these triangles are congruent?

1. Hanger
2. Watermelon
3. Triangle Ruler
4. Pizza
5. Triangle Roof house​

Answers

4 because it’s a triangular ruler

what are the process of boots up a computer?​

Answers

Answer:

The process of boot-up a computer are: Power On, POST, Load BIOS, Operating system load, and transfer of control to the OS.

Answer:

» Switch on the power from the power source.

» The power supply sends electric signals to the motherboard.

» The BIOS performs the POST ( Power On Self Test)

» The CMOS chip loads configurations in the RAM

» The kernel of the operating system loads files in the hard disk.

» The operating system loads the welcome screen, where the computer varifies the user to see if he or she is a legitimate user through a password.

» Load the desktop.

What protects your computer so that it doesn’t get a computer virus?

Internet Browser

Antivirus Software

Keyboard Protector

My Teacher

Answers

Answer:

Antivirus Software

Explanation:

I believe Antivirus Software.

Sorry if I am wrong.

Answer:

Antivirus Software

Explanation:

Antivirus scans the incoming files or code that has been passed through your network traffic. Companies who build these softwares maintain a database of viruses that are already known. That database teaches the antivirus to remove, flag or quarantine any viruses in your computer.

write a program to input 100 students marks and find the highest marks among the them​

Answers

Answer:

Explanation:

The following code is a Python program that allows you to input 100 marks. You can input the value -1 to exit the loop early. Once all the marks are entered the program prints out the highest mark among all of them. The output can be seen in the attached picture below with a test of a couple of marks.

marks = []

for x in range(100):

   mark = int(input("Enter a mark: "))

   if mark == -1:

       break

   else:

       marks.append(mark)

print("Max value: " + str(max(marks)))

What are the main dimensions of information system and their components

Answers

Answer:

The dimensions of information systems include organizations, management, and information technology. The key elements of an organization are its people, structure, business processes, politics, and culture. An organization coordinates work through a structured hierarchy and formal standard operating procedures.

The most serious security threat to Bluetooth-enabled devices is ____, which occurs when a hacker gains access to the device and its functions without the owner's consent.

Answers

The most serious security threat to Bluetooth-enabled devices is [tex]\sf\purple{bluebugging}[/tex], which occurs when a hacker gains access to the device and its functions without the owner's consent.

[tex]\large\mathfrak{{\pmb{\underline{\orange{Happy\:learning }}{\orange{.}}}}}[/tex]

SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplies two int values to find their product.Three ints should be passed to the multiplyNumbers() function, the two numbers to be multiplied (num1 and num2) should be passed by value, and another int (product) to hold the product of the two numbers should be passed by reference, enabling the multiplyNumbers() function to change its value.The source code file provided for this lab includes the necessary variable declarations and input and output statements. Comments are included in the file to help you write the remainder of the program.Instructions:Open the source code file named MultiplyTwo.cpp using the code editor.Write the multiplyNumbers() function, the function declaration, and the function call as indicated by the comments.Execute the program by clicking "Run Code."Rewrite the multiplyNumbers() function to pass the two numbers (num1 and num2) by value and to pass product by address.Execute the program. It should generate the same output.// MultiplyTwo.cpp - This program calculates the product of two numbers.// It demonstrates pass by reference and then pass by address.// Input: None// Output: The product of two numbers#include using namespace std;// Write function declaration hereint main(){int num1 = 10;int num2 = 20;int product = 0;// Print value of product before function callcout << "Value of product is: " << product << endl;// Call multiplyNumbers using pass by reference for product// Print value of calculated productcout << num1 << " * " << num2 << " is " << product << endl;return 0;} // End of main function// Write multiplyNumbers function here; use pass by reference for result of multiplication. Then use pass by address.

Answers

Answer:

Declare the method prototype using:

void multiplyNumbers(int x, int y,int &product);

Call the function using:

multiplyNumbers(num1, num2,product);

Lastly, the method is as follows:

void multiplyNumbers (int x, int y,int &product) {

  product = x * y;

  return; }

Explanation:

Declare the method prototype using

void multiplyNumbers(int x, int y,int &product);

Call the function using

multiplyNumbers(num1, num2,product);

The method is as follows; the & written in front of product implies that product is passed by reference

void multiplyNumbers (int x, int y,int &product) {

This calculate the product

  product = x * y;

This returns nothing

  return; }

See attachment for complete program

What is edge computing?

Answers

Answer:

I basically means something like the cloud, where your data is uploaded to servers and is then processed and transferred back to you when you need it.

Explanation:

Hope this helps :)

A de-centrally-powered, fully accessible IT architecture that always enables mobile computer technology as well as internet technologies, is determined as Edge computing.

Processing is done through edge computing, instead of sent off to the server farm, either by the equipment rather than via a localized server computer system.

Examples of edge computing include:

Smart grid excellent analysis.Oilfield rigs security monitoring.Video streaming.Drone-enabled agricultural management.

Learn more about edge computing here:

https://brainly.com/question/22646214

A program developed for a Web store represents customer account balances using a format that approximates real numbers. While testing the program, a software developer discovers that some values appear to be mathematically imprecise. Which of the following is the most likely cause of the imprecision?
A. The account balances are represented using a fixed number of bits, resulting in overflow errors.
B. The account balances are represented using a fixed number of bits, resulting in round-off errors.
C. The account balances are represented using an unlimited number of bits, resulting in overflow errors.
D. The account balances are represented using an unlimited number of bits, resulting in round-off errors.

Answers

Answer:

B.

Explanation:

The most likely reason for this would be that the account balances are represented using a fixed number of bits, resulting in round-off errors. Since all of the numbers being used are real numbers they would have a fixed 32 bits of data. When these values are multiplied or divided they can be irrational numbers that never end, and therefore are cut off in order to fit the available data. This would cause the numbers to be rounded and can lead to the answer being imprecise.

Question # 6
Fill in the Blank
Complete the following sentence.
The World Wide Web launched to the public in

Answers

CERN released the code for the World Wide Web to the public on April 30, 1993. Subsequently, CERN made a release available under an open licence, which was a more reliable strategy for maximising its reach.

Which year was India's introduction to the World Wide Web?

The first time the world wide web was ever made accessible to the general public on the Internet was on August 6, 1991. It has changed so little in 26 years from how it was then.

In 1994, what was invented?

The IBM Simon, the first smartphone in history, goes on sale on August 16. The first PlayStation game console is made available in Japan on December 3. The first high-brightness blue LED is created, and the researchers are awarded the 2014 Nobel Prize for their discovery.

To know more about World Wide Web visit:-

https://brainly.com/question/20341337

#SPJ1

state the function of a URL in a website​

Answers

Answer:

It's purpose is to access a webpage.

Explanation:

A URL contains detailed information on the webpage such as, the domain name, protocol, and path. This information directs the browser to the desired page.

Declare a typedef struct named jumper_t that will have four parts: character array name that is 16 in length, double array of tries that is N_TRIES in length, double best_jump, double deviation 2. Write one line to declare an array variable, named jlist of the above struct type, with a length of ten. No initialization required.

Answers

Answer:

The typedef struct is as follows:

typedef struct jumper_t {

  char name[16];

  double tries[N_TRIES];

  double best_jump;

  double deviation;

} jumper_t;

The declaration of jlist is:

jumper_t jlist[10];

Explanation:

This defines  the typedef structure

typedef struct jumper_t {

The following declares the variables as stated in the question

  char name[16];

  double tries[N_TRIES];

  double best_jump;

  double deviation;

}

This ends the typedef definition

jumper_t;

(b) The declaration of array jlist is:

jumper_t jlist[10];

If myClass has a constructor with a parameter of type String, select the other constructor that should be included.
a. public void myClass( ) {. . .}
b. public myClass(int value ) {. . .}
c. public myClass(String str1, String str2) {. . .}
d. public myClass( ) {. . .}

Answers

Answer:

d. public myClass( ) {. . .}

Explanation:

A constructor is a special method that is called when an object of a class is created. It is also used to initialize the instance variables of the given class. A class may have one or more constructors provided that these constructors have different signatures. A class that does not have a constructor explicitly defined has a default parameterless constructor.

Having said these about a constructor, a few other things are worth to be noted by a constructor.

i. In Java, a constructor has the same name as the name of its class.

For example, in the given class myClass, the constructor(s) should also have the name myClass.

ii. A constructor does not have a return value. It is therefore wrong to write a constructor like this:

public void myClass(){...}

This makes option a incorrect.

iii. When a constructor with parameters is defined, the default parameterless constructor is overridden. This might break the code if some other parts  of the program depend on this constructor. So it is advisable to always explicitly write the default parameterless constructor.

This makes option d a correct option.

Other options b and c may also be correct but there is no additional information in the question to help establish or justify that.

What is wrong with a MOV BL, CX instruction?

Answers

Answer:

The MOV bl , cx instruction is wrong because the contents of cx are to big for bl .

I think this is the answer.

list with ecamples five important applications areas of computer today​

Answers

Answer:

Banking

Education

Business

Engineering and Architectural designs

Health

Explanation:

Banking : Shifting from the manual method of having to input information into hard book ledgers. Data and payment information can now be stored on computers. This may be used to prevent information duplication, forecasting and efficient payment purposes.

Education : With the use of computers today, students can now take computer based tests which are not only easily accessible and curtails geographical issues, they are also faster.

Business : With computers, businesses can now manage and their store customer information, inventory management and sales tracking.

Engineering and Architectural designs : With computers, thesw fields can now boast of computer aided designs which allows experts produce both 2 and 3 - dimensional prototype of equipments, buildings, building plans or other engineering structures.

Health : Adequate health record, patient appointment, digitally monitored pulse rate are some of the uses of computers in medicine.

What are the characteristic features of TFTP?

Answers

Answer:

TFTP Server is used for simple file transfer

Explanation:

Example

boot-loading remote devices

how to get fast frontend development online job as a beginner?​

Answers

Answer:

hmmm well what is your magager?? every job will ask you what you can do.

Write a class called AddThreeGame that allows two players to play a game in which they alternately choose numbers from 1-9.

Answers

Answer:

Explanation:

The following code is written in Python, it creates the AddThreeGame as requested for 2 players. Outputting the desired output after each player has chosen a number and checking for a winner after every choice. Due to technical reasons, I had to add the code as a txt file below and the output can be seen in the attached picture.

Topic: Graphs.1.) Bob loves foreign languages and wants to plan his courseschedule for the following years. He is interested in the followingnine language courses: LA15, LA16, LA22, LA31, LA32, LA126, LA127,LA141, and LA 169. The course prerequisites are.i.) LA15: (None)ii.) LA16: LA 15iii.) LA22: (None)iv.) LA31:LA 15v.) LA32:LA16, LA31vi.) LA126: LA22, LA32vii.) LA127: LA 16viii.) LA141:LA22, LA 16ix.) LA 169: LA32.Find the sequence of courses that allows Bob to satisfy allthe prerequisites.

Answers

Answer:

  LA15; LA22

LA16; LA31; LA32

  LA169; LA126;

  LA127; LA141

Explanation:

Given

[tex]Courses: LA15,\ LA16,\ LA22,\ LA31,\ LA32,\ LA126,\ LA127,\ LA141,\ LA 169.[/tex]

Required

Course sequence to satisfy the prerequisite

From the course prerequisite, we have:

[tex]1.\ LA15 \to None[/tex]    and    [tex]3.\ LA22 \to None[/tex]

This means that LA15 and LA22 are the base courses, and they have no prerequisite. So, we have:

[tex][LA15; LA22][/tex]

LA16 and LA31 have LA15 as their direct course prerequisite. So, the sequence becomes

[tex][LA15 \to [LA16, LA31]; LA22][/tex]

To complete the sequence, we read each course and place them other their prerequisite.

See attachment for complete tree

From the tree, we have the sequence to be:

LA15; LA22

LA16; LA31; LA32

LA169; LA126;

LA127; LA141

Write a program named split_me.py that accepts a string in the format Age.FirstName and returns the value FirstName is Age years old. Length of Mary is X. Example: 22.Mary >> Mary is 22 years old. Length of Mary is 4

Answers

age,name = input('Enter a string: ').split('.')

print(name+' is '+age+' years old. Length of '+name+' is '+str(len(name)))

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

write a java program to input the corresponding data to print the result of the following expression
y=ax²+bx+c

Answers

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 float a, b, c, x, y;

 a = input.nextFloat();

 b = input.nextFloat();

 c = input.nextFloat();

 x = input.nextFloat();

 y = a * x * x + b * x + c;

 System.out.print(y); }}

Explanation:

This declares all variables

 float a, b, c, x, y;

The next 4 lines get input for a, b, c and x

 a = input.nextFloat();

 b = input.nextFloat();

 c = input.nextFloat();

 x = input.nextFloat();

This calculates the value of y using [tex]y = ax^2 + bx + c[/tex]

[tex]y = a * x * x + b * x + c;[/tex]

This prints the calculated value of y

 System.out.print(y);

Describe FIVE distinct features of multi-threaded programming. Your answer should be language independent. g

Answers

Answer:

1) Execution time speed

2) Responsiveness

3) use of multi-processor architecture

4) sharing of resources

5) use of resources

Explanation:

The Distinct features are

1) Execution time speed : The time of execution in a multithreaded programming is lesser than a Non multithreaded programming which means the execution speed is faster

2) Responsiveness : Multithreaded programming languages are more responsive because every thread in the language is independent of others hence they can respond/generate responses based on its execution

3) Multithreaded programming makes use of multi-processor architecture given that each response from the threads are simultaneous

4) Ease in sharing of resources by the multiple threads found in the programming

5) Light weight of threads makes the need for resources by the threads in the programming language to be lesser when compared to other programming languages

Please help it’s timed

Answers

Answer:

2nd, third, and the 5th one

Explanation:

Write a program second.cpp that takes in a sequence of integers, and prints the second largest number and the second smallest number. Note that in the case of repeated numbers, we really mean the second largest and smallest out of the distinct numbers (as seen in the examples below). You may only use the headers: and .

Answers

Answer:

The program is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

   int n;

   cout<<"Elements: ";

   cin>>n;

   vector <int>vectnum;

   int numInp;

   for (int i = 1; i <= n; i++){        cin>>numInp;        vectnum.push_back(numInp);    }

   int big, secbig;

   big = vectnum.at(0);      secbig = vectnum.at(1);

   if(vectnum.at(0)<vectnum.at(1)){     big = vectnum.at(1);  secbig = vectnum.at(0);   }

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

     if (vectnum.at(i) > big) {

        secbig = big;;

        big = vectnum.at(i);

     }

     else if (vectnum.at(i) > secbig && vectnum.at(i) != big) {

        secbig = vectnum.at(i);

     }

  }

  cout<<"Second Largest: "<<secbig<<endl;

  int small, secsmall;

  small = vectnum.at(1);       secsmall = vectnum.at(0);

  if(vectnum.at(0)<vectnum.at(1)){ small = vectnum.at(0);  secsmall = vectnum.at(1);   }

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

     if(small>vectnum.at(i)) {  

        secsmall = small;

        small = vectnum.at(i);      }

     else if(vectnum.at(i) < secsmall){

        secsmall = vectnum.at(i);      }   }

  cout<<"Second Smallest: "<<secsmall;

  return 0;

}

Explanation:

See attachment for explanation

which of the following resources type is mostly likely to be shared common resource in a computer network environment
a) printers
b) floppy disk drives
c) speakers
d) keyboards​

Answers

Answer:

A )Printer

Explanation:

In office multiple user can send request to print a doc......

Other Questions
1. The Fascist Italian government did not believe in Free Press.True or false? w is directly proportional to yw is inversely proportional to x?(a) When y = 4, w = 14Work out the value of w when y = 9 Louis Pasteurs discoveries were important because theya.were a step in preventing disease.b.led to the science called genetics.c.allowed safe surgery.d.led to the end of World War II. How do the products of a nuclear fusion reaction differ from reactants? Please help me Simplify 1-97+3 On June 1, 2021, Dirty Harry Co. borrowed cash by issuing a 6-month noninterest-bearing note with a maturity value of $420,000 and a discount rate of 10%. Assuming straight-line amortization of the discount, what is the carrying value of the note as of September 30, 2021 The initial condition for a one-dimensional transient conduction problem is the specification of:_______. A. the time at which the solution to the problem starts. B. the properties at the start of the solution. C. the temperature at the initial time throughout the domain. D. None of the above There is a great importance of skilled human resources in development of acountry.Justify with examples what is global/international cooperation Have you ever___by a dog. a. bit b.been bitten c.bitten d.bite Given: AD BC and AD || BCProv: ABCD is a parallelogram.Angles Segments Triangles Statements ReasonsSASCPCTCAreflexive propertyalternate interior angles theoremBStatements1. AD BC 2. ZDAC and BCAare alt. interior angles3. AD || BCReasons1. given2. def. of alt. interior anglesD.3. givenCorrect Assemble the nextstatement Costly Corporation plans a new issue of bonds with a par value of $1000, a maturity of 37 years, and an annual coupon rate of 11.0%. Flotation costs associated with a new debt issue would equal 3.0% of the market value of the bonds. Currently, the appropriate discount rate for bonds of firms similar to Costly is 9.0%. The firm's marginal tax rate is 50%. What will the firm's true cost of debt be for this new bond issue I NEED HELP ASAPPP!! Pleasee Describe a few of the external stressors we can experience in life and why they cause us stress. n HIJ, the measure of J=90, HJ = 21, JI = 20, and IH = 29. What ratio represents the cosine of H? CD is the Diameter. The measure of Arc CD is lle Find the length of the radius in the circle. What is the food source of omega-3 fatty acids? Help pls im taking the test hurry plssssss thank u At an auditorium, 3 1/2 sections are filled with people watching a play. Exactly 3/5 of the people watching the play are parents. What fraction of the sections are filled with parents? Please help me Im not getting this answer Megan runs a bakery in which she can sell cakes for $12.95. Write a function for the amount of profit, in dollars, she makes for selling n amount of cakes.