1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andreyy89
3 years ago
9

Write a function that multiplies two decimal string representations of non-negative integers. The function takes two parameters

cx and cy, which are string decimal representations of integers, for example, cx = "1237091" cy = "23015" and returns their product as a string decimal representation: "28471649365". This is the function’s signature: Bool Multiply Integers(char* cx, char* cy, char* res);
Engineering
1 answer:
Illusion [34]3 years ago
7 0

Answer:

See explaination

Explanation:

#include<bits/stdc++.h>

using namespace std;

string multiply(char* num1,char* num2)

{

int l1 = strlen(num1);

int l2 = strlen(num2);

if(l1 ==0 || l2 == 0)return "0";

vector<int> result(l1+l2,0);

int in1=0,in2=0;

for(int i=l1-1;i>=0;i--)

{

int carry = 0;

int n1 = num1[i]-'0';

in2 = 0;

for(int j = l2-1;j>=0;j--)

{

int n2 = num2[j]-'0';

int sum = n1*n2 + result[in1+in2] + carry;

carry = sum /10;

result[in1+in2] = sum%10;

in2++;

}

if(carry>0)

{

result[in1+in2]+=carry;

}

in1++;

}

int i = result.size()-1;

while(i>=0&&result[i]==0)

{

i--;

}

if(i == -1)return "0";

string s = "";

while(i>=0){

string ch = "0";

ch[0] = '0'+result[i--];

s += ch;

}

return s;

}

int MultipyCIntegers(char* cx,char* cy,char* res)

{

string result = multiply(cx,cy);

if(strlen(res)!=result.length())return 0;

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

{

if(res[i]!=result[i])

{

return 0;

}

}

return 1;

}

int main()

{

char* s1 = "1235421415454545454545454544";

char* s2 = "1714546546546545454544548544544545";

char* ans = "2118187521397235888154583183918321221520083884298838480662480";

cout<<MultipyCIntegers(s1,s2,ans);

}

You might be interested in
Manufacturers frequently make choices about their suppliers of raw materials based on their impact on society and the environmen
love history [14]
Manufacturers seek attention
4 0
3 years ago
D. projectile
Colt1911 [192]
Answer: parabola

Explanation:

•Parabolic Trajectory:

In conclusion, projectiles travel with a parabolic trajectory due to the fact that the downward force of gravity accelerates them downward from their otherwise straight-line, gravity-free trajectory.
5 0
3 years ago
A company intends to market a new product and it estimates that there is a 20% chance that it will be first in the market
Stells [14]

The EMV - Ending Market Value is given as:
$2,400,000.

<h3>How is the EMV Arrived At?</h3>

The EMV is given as:

BMV x (i + r); Where

BMV is the Beginning Market Value; and

r is the interest rateor percentage given.

Hence the EMV = 2,000,000 x ( 1 + 20%)

= 2,000,000 x 1.2

= $ 2, 400,000.

It is to be noted that the BMV is the Beginning Market Value which is the value of an investment at the start of the business period.

Learn more about Market Value at:

brainly.com/question/1350233

4 0
3 years ago
Stone has been used as a building material since ancient times because of its compressive strength, which is the __________.
Doss [256]

Complete Question:

Stone has been used as a building material since ancient times because of its compressive strength, which is the?

Group of answer choices

A. ability to support pressure without breaking.

B. ability to press down and become solidly fixed in the ground.

C. relative weight of a block of stone to its size.

D. force a block exerts on the blocks around it.

Answer:

A. ability to support pressure without breaking.

Explanation:

Stone has been used as a building material since ancient times because of its compressive strength, which is the ability to support pressure without breaking.

Compressive strength can be defined as the ability of a structural element or particular material to withstand an applied, which is aimed at reducing the size of the structural element.

Simply stated, it is the ability of a structural element or material to withstand an applied load without deflections, fracture or having any crack.

In this context, a stone possesses the ability to resist or withstand compression loads.

Some examples of other materials or structural elements having good compressive strength are steel, bones, concrete etc. The standard unit of measurement of the compressive strength of a material is Mega Pascal (MPa) or pound-force per square inch (psi) in the United States of America.

7 0
4 years ago
A rigid, insulated tank that is initially evacuated is connected through a valve to a supply line that carries helium at 200 kPa
Aleks04 [339]

Answer: a 8143.71 kJ/kg

b 393.15 K

Explanation:

This system is an isobaric process in which there is no change in pressure a quasistatic process where a pressure distribution exists

a since no change in pressure =0 the system does work thus

FOR HELIUM  properties in standard thermodynamic chart

cv = 3.1 kJ/kgK

M = Molar mass = 4 kg/kmol

R = Universal gas constant = 8.314 kJ/kg K

cp ≈ cv +R /M = 3.1 + 8.314 /4 = 5.1785 kJ/kgK  

Cp = cp * M = 5.1785 kJ/kgK * 4 kg/kmol  = 20.714 kJ/kgkmol

T = 120  °C  to Kelvin = 120 + 273.15k = 393.15 K

W =n Cp ΔT = 1 kmol * 20.714 kJ/kg kmol* 393.15 K = 8143.71 kJ/kg

b convert T °C = T K thus 120 + 273.15 K = 393.15 K

P₁/T₁ = P₂/T₂

200 kPa/ 393.15 K = 200 kPa/T₂

T₂ = 200 kPa * 393.15 K/ 200 kPa = 393.15 K or 120 k

7 0
4 years ago
Other questions:
  • Estimate the magnitude of the force, in lbf, exerted on a 12-lb goose in a collision of duration 10^-3s with an airplane taking
    15·1 answer
  • Liquid ethanol is a flammable fluid and can release vapors that form explosive mixtures at temperatures above its flashpoint at
    9·1 answer
  • Which of the following identifies a criterion needed to become a civil engineer?
    15·1 answer
  • What are the basic parts of a radio system
    15·1 answer
  • Felix has placed some Copper wire (where the official looked up inferred absolute temperature is 234.5 Celsius) 28 gauge wire in
    14·1 answer
  • Looking for new information is one reason you should do research for a speech.
    15·2 answers
  • A seasonal color change helps animals in the Taiga to
    11·1 answer
  • How many parts (screws and bolts included) does the average car have?
    9·2 answers
  • A 280 km long pipeline connects two pumping stations. It is desired to pump 0.56 m3/s of oil through a 0.62 m diameter line, the
    14·1 answer
  • A work element in a manual assembly task consists of the following MTM-1 elements: (1) R16C, (2) G4A, (3) M10B5, (4) RL1, (5) R1
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!