Multiply a set of complex numbers

Assignment Help C/C++ Programming
Reference no: EM13164646

Write a C program to concatenate (i.e., to join) two strings. Specifically, implement a function called

         char* my_strcat(char *s1, char *s2);

that takes as input pointers to two strings (s1 and s2), dynamically creates an array (say s) of the right size needed to store the concatenation of the two strings, concatenates s2 to the end of s1 (by first copying s1 to s, then s2 to s), and returns the address of s. For example, if s1 is yahoo\0 and s2 is .com\0, then s becomesyahoo.com\0

In the main function, prompt the user to enter two strings (without spaces), call themy_strcat function to concatenate the two strings, and finally print the string returned by the function.

#define SIZE 50 in the program, assuming that the user enters strings containing at most 50 characters (without spaces), and use SIZE whenever needed in the program, so that the program works correctly even if SIZE is changed.

Problem 2:

Write a C program to multiply a set of complex numbers stored in an array (that has been dynamically allocated). Specifically, first prompt the user to enter how many complex numbers need to be multiplied, dynamically create an array to store the user specified number of complex numbers, multiply the numbers, and finally print the result (in the a +bi format).

One can multiply the set of complex numbers in an iterative manner (multiplying two complex numbers in each iteration). To multiply the two complex numbers (in each iteration) you can use the "multC_ByValue" and "multC_ByRef" functions that you implemented in the last assignment. "sizeof(complex)" would get you the number of bytes needed to store a complex number.

Reference no: EM13164646

Questions Cloud

Controversial trayvon martin case and racism : Trayvon Martin was a 17 year-old African American teenager. He was unarmed and was shot by George Zimmerman in February of 2012. George Zimmerman was a 28 year-old Hispanic American who was the neighborhood watchperson in his Florida community.
Society literature matters more than as entertainment : What have you read or seen in the last year that supports the idea that in your own society literature matters more than as merely a form of entertainment? "
Individual business decisions : To what extent can individual business decisions (as opposed to economic forces) explain deterioration in working conditions for many workers?
Dynamic character arrays : Dynamic character arrays str and add contain strings. Write a function append that uses str and add as arguments and appends add to the end of str. Write a main program that illustrates the use of function append to concatenate five strings.
Multiply a set of complex numbers : Write a C program to multiply a set of complex numbers stored in an array (that has been dynamically allocated). Specifically, first prompt the user to enter how many complex numbers need to be multiplied, dynamically create an array to store the ..
Afterwards a way for the user to input : And so on and so forth then afterwards a way for the user to input that they finished a particular task on the list. After the user has input that they have finished a particular task the program should be print "Good Job!" or "Keep it up!"
User enters a list of car parts : So if the user enters a list of car parts, the programm holds this list. Afterward, when the user types in the name of the part the programm outputs that name from the list.
Individual genes are substrings of a genome : Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..
Function that accepts a pointer to a c-string : Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. Also have it display the average number of letters in each word.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a scanf statement to read in one number (int

1) Write a scanf statement to read in one number (int), and another statement to print out that number.

  Dealerships are awarded the rebate

Dealerships are awarded the rebate on a quarter-by-quarter basis, only for quarters where their actual sales exceeded expected volumes for that quarter. Expected sales volumes for each quarter are as follows:

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

  Write a program with a while loop to print 1 to n in square

Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user. (i) Write the same program using a for-loop

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the output of the program

Design a C++ program that will interactively prompt for and read the name of the input file interactively prompt for and read the name of a file to write the output of the program to write the following to the specified output file your name, sect..

  Emulates the behavior of a bus

Write a program that emulates the behavior of a bus. The bus must have a schedule ( a finite number of times for it to stop) and a certain capacity (number of passengers). In this program the bus has two states: stopped and going.

  Write function compute square root together with prototype

Write a C++ function called compute together with its prototype that is passed 2 integers, A and B and returns the square root of A2+B2 ,as a double.

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  20 integers saved in a file called "data.txt"

There are 20 integers saved in a file called "data.txt" (just a random txt file with some numbers) All integers are in the range from 1 to 10

  Program to translates letter grade into number grade

In C++ (should be able to compile in Visual Studio 2010): Write a program to translates letter grade into number grade. Letter grades are A,B,C,D and F, possibly followed by a + or -.

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd