Write code to find all pairs of integers in a sorted array

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

Assignment

Question 1. Write a program that reads a char as input, and determines if it is a lowercase letter, up¬percase letter, a digit or something else (call this a special character).

Question 2. The Taylor series expansion for the exponential function, for small values of x is given by:

ex = 1 + x + x2/2! + x3/3! + . . .

Write a program that takes as input the value of x (for example 0.01), and computes ex using the above approximation. The program should sum up n terms, and stop when the value of the nth term is less than a predefined constant accuracy, set to 0.00001.

Question 3. Write a program to generate m random integers from an array of size n, such that the probability of selecting even indexed elements is twice that of odd indexed elements. The same element may be selected multiple times. As an example, let n = 100 and m = 30. Read in the array elements from the provided data file ArrayInp.dat, using the fscanf() func¬tion. Utilize the function rand() to generate a pseudo random number and the function srand() to seed the random number generator. Start with the code RandomArrayGen¬erate.c provided on the Blackboard.

Question 4. Design an algorithm, and write the code to find all pairs of integers in a sorted array, which sum up to a specified value. For example, if the given array is

int arrN[10] = {1, 3, 7, 14, 22, 35, 44, 45, 46, 53};

and the specified sum is 49, the output would be:
3 46
14 35

The algorithm should work well for very large array sizes.

Question 5. Write a program that initializes an array, and prints out its elements using the pointer no¬tation and pointer incrementing.

Question 6. In the file Cauchy.dat provided on the Blackboard, find all occurrences of the word mathematician. For reading the data from the input file, you can use the fscanf() function with the %s specifier. Utilize the string function strncmp() for string comparison.

Attachment:- data files.zip

Verified Expert

I came across the issue find that this question was about the how to get whether the entered character in uppercase or lowercase or a numeric or a special digit the final one. Converting the Taylor series expansion of mathematics to the c++ programming. Uses the randomization to find out the array's element of the basic the array position that came from the random generated. Written a program for find out the combination of number through which one can get the entered number by using the 2 or more combination of array elements. And wrote the algorithm too for this problem. Uses pointer to walk through the array to display its values. Read the data from the .dat file as an integer one by one and displayed as per the requirements.

Reference no: EM131849071

Questions Cloud

How intervention strategies are designed : Key factors that account for changes in behavior. An explanation of how intervention strategies are designed within this theoretical orientation.
Explain why the gas is not behaving ideally : After the piston decreases the volume of the cylinder, the measured pressure was found to be less than what would be predicted by the Ideal Gas Law.
Create schema that supports companys business and processes : Create a schema that supports the company's business and processes. Explain and support the database schema with relevant arguments that support the rationale.
How many moles of water are necessary : According to the following reaction, how many moles of water are necessary to form 0.452 moles magnesium hydroxide?
Write code to find all pairs of integers in a sorted array : EEO 224: Object-Oriented Programming for Electrical and Computer Engineers Spring 2018 - Write a program that reads a char as input
Temperatures and high pressures ethene gas : At low temperatures and high pressures ethene gas, C2H4 (g), does not behave like an ideal gas.
Calculate the total pressure in the cylinder : A rigid 7.80 L sealed vessel containing 2.700 mol of O2 (g), 0.600 mol of C2H4(g), and 2.400 mol of Ne(g) has an internal temperature of 85.0 C.
Expect the water level to rise the same amount : Would you expect the water level to rise the same amount in both cylinders? Explain.
Determines which business goals are critical or important : Determines which business goals are critical or important and which technical risks may affect business operations.

Reviews

inf1849071

3/29/2018 5:20:48 AM

Please confirm that is it allowed to use in c++. I am waiting for your quick response to this assignment. I am sure your experts can do this before this short deadline. Following possible attachments are available: Cauchy.dat ArrayInp.dat RandomArrayGen-erate.c ArrayInp.dat how to get whether the entered character in uppercase or lowercase or a numeric or a special digit the final one. Converting the Taylor series expansion of mathematics to the c++ programming. Uses the randomization to find out the array's element of the basic the array position that came from the random generated Written a program for find out the combination of number through which one can get the entered number by using the 2 or more combination of array elements. And wrote the algorithm too for this problem. Uses pointer to walk through the array to display its values Read the data from the .dat file as an integer one by one and displayed as per the requirements.

len1849071

2/5/2018 3:36:03 AM

Grading In addition to code functionality, there will be points for coding style, algorithm design and comments. A few useful comments would be sufficient. 4 Assignment Submission The Assignments must be submitted on the Blackboard, and should include the following: 1. The C++ source code, with one file per problem. 2. Screen shots which show each program executing. All the screen shots maybe in a single .pdf or .jpg file.

len1849071

2/5/2018 3:35:56 AM

EEO 224: Object-Oriented Programming for Electrical and Computer Engineers Spring Instructor: Vibha Mane Assignment 1 Review of C Topics Total Score: 15 points All problems carry equal weight of 2 points each Discussion Board (3 points) There are points for participating in the Discussion Board. You are encouraged to ask questions on clarifying the assignments or related material, post your thoughts and some hints. Please do not post complete solutions.

Write a Review

C/C++ Programming Questions & Answers

  Series of different lengths

Before you enter the series, you are to have the program ask the user how many marks there are. After the last mark is entered, show the average of the inputted marks, rounded to 1 decimal point. Test your program to ensure that it works for serie..

  Create a checkbook program

Create a Checkbook program and Check to the checkbook. Collect all information for a single check and add it to the checkbook. Call the function to display the values for the check before adding the check.

  Where is the error in this code sequence?

Where is the error in this code sequence?Explain what the problems are and how to fix them.

  Print a string backward

Write a recursive function string Reverse that takes a character array as an argument, prints it back to front and returns nothing.

  Implement a version of the zombiedash

For this assignment you must implement a version of the 'ZombieDash' video game on the Teensy LCD board. The game is to be written in the C programming language. The implementation will make use of the LCD screen, buttons, LEDs, potentiometer, and..

  Write program that graphically displays a vertical bar chart

Write a program that graphically displays a vertical bar chart. The input is an array of integers. Use the index of an array entry as the label on the X axis.

  Only letters are affected

You are to write a ROT13 (for "rotate 13") decoder to translate a secret message from its encoded state to something readable. In a ROT13 code, 'a' is shifted 13 letters to 'n', 'B' to 'O', 'c' to 'p', 'D' to 'Q', ..., 'N' to 'A', 'o' to 'b', 'P' ..

  Calculate the total expences

Trying to fugure out how to enter a formula in a cell(d10) that multiplies 30 by the value in another cell (c27), then make the other cell (c27) an absolute cell reference in the formula. Copy the formula to cells d11:d13, and then calculate the t..

  Program that asks for the number of runs scored

Write a C++ program that asks for the number of runs scored in each inning of a little league baseball game. The game normally lasts 5 innings.

  Discuss about the combination of the operator name

C++ permits overloading of operators with the same restrictions as for overloading of functions: each version must have a unique signature.

  What tasks are involved in designing database table

WHAT IS THE NAME FOR COLUMN THAT UNIQUELY IDENTIFIES A RECORD?

  It would be cool if a device was actually part

Have you ever been low on cash and couldn't go beyond a certain dollar limit when shopping? You sort of need a calculator in your head. It would be cool if a device was actually part of the cart and as you add an item into the cart it would increm..

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