write an interactive menu driven c++ program that creates a text file (say text1) and then display the file. create another text file (as text) by converting each line of the 'text1' file into a lowercase string. display the contents of 'text' file.
Numbers in String - 1
Given a string, write a program to return the sum and average of the digits of all numbers that appear in the string, ignoring all other characters.
Input
The input will be a single line containing a string.
Output
The output should contain the sum and average of the digits of all numbers that appear in the string.
Note: Round the average value to two decimal places.
Explanation
For example, if the given string is "I am 25 years and 10 months old", the digits of all numbers that appear in the string are 2, 5, 1, 0. Your code should print the sum of all digits(8) and the average of all digits(2.0) in the new line.
Sample Input 1
I am 25 years and 10 months old
Sample Output 1
8
2.0
Sample Input 2
Tech Foundation 35567
Sample Output 2
26
5.2
Sample Input 3
Anjali25 is python4 Expert
Sample Output 3
11
3.67You are required to: v. write pseudocode algorithm to determine the integral of a function between two specified points using the rectangular rule. vi. write C++ computer programs to determine the integral of a function between two specified points using the rectangular rule.
The rectangular rule (also called the midpoint rule) is perhaps the simplest of the three methods for estimating an integral. i. Integrate over an interval a ≤ x ≤ b. ii. Divide this interval up into n equal subintervals of length h = (b − a)/n. iii.Approximate f in each subinterval by f(x*j ), where x*j is the midpoint of the subinterval. iv. Area of each rectangle: f(x*j)h, f(x*j)h,. . . , f(x*n)h.
The bisection method is used to find the roots of a polynomial equation. It separates the interval and subdivides the interval in which the root of the equation lies. The principle behind this method is the intermediate theorem for continuous functions. It works by narrowing the gap between the positive and negative intervals until it closes in on the correct answer. This method narrows the gap by taking the average of the positive and negative intervals. For any continuous function f(x), i. Find TWO (2) points, say a and b such that a < b and f(a)* f(b) < 0 ii. Find the midpoint of a and b, say “t” iii. t is the root of the given function if f(t) = 0; else follow the next step iv. Divide the interval [a, b] v. If f(t)*f(b) <0, let a = t vi. Else if f(t) *f(a), let b = t vii. Repeat above three steps until f(t) = 0.
The following table shows the essential data required for this application. Hillar Furniture Company Purchasing Data is shown below: Attribute Name Material_ID Material_ Name Unit_of_Measure Standard_Cost Vendor_ID Vendor_name Unit_price Terms_Code Terms Sample Value 3792 Hinges 3” locking Each GHC 5.00 V300 Apex Hardware GHC 4.75 1 COD a) Using the dependency diagram, identify the functional dependencies for this data. You may assume the following: i. Each material has one or more suppliers. Each supplier may have supply one or more items or may not supply many items. ii. The unit price for a material may vary from one vendor to another iii. The terms of a code for a supplier uniquely identifies the terms of a sale (e.g. code 2 means 10% net 30 days, etc.). The terms for a supplier are the same for all material items ordered from that supplier. [E][9] b) Convert your data into a set of 3NF relations, identifying all the primary and foreign keys
Description
You are given an array containing 'n' elements. The array can contain both positive and negative integers. Determine the sum of the contiguous subarray with the maximum sum.
Consider the array {8, -9, 3, 6, 8, -5, 7, -6, 1, -3}.
The maximum subarray will be 3, 6, 8, -5, 7.
The maximum subarray sum will be 3+6+8+(-5)+7 = 19
Input Format:
The input contains the number of elements in the array, followed by the elements in the array.
Output Format:
The output contains the maximum subarray sum.
Sample Test Cases:
Input:
10 8 -9 3 6 8 -5 7 -6 1 -3
Output:
19
Input:
5 8 9 4 5 7
Output:
33
write a program to pass two numbers as parameters to a function which is used to swap the two
numbers.
Write a simple visual basic program to find the average of five numbers
Write a program to computer the value of 1500+1000-450*10+300