How to form a Pseudocode and Flowcharts for a Vending Machine
Print the two strings, firstString and secondString, in alphabetical order. Assume the strings are lowercase. End with newline. Sample output:
Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate
Sample Run1
Enter two numbers: 3 15
Do you want another operation: Yes
Enter two numbers: 45 56
Do you want another operation: No
Output1: Sum = 119
Sample Run2
Enter two numbers: 33 150
Do you want another operation: Yes
Enter two numbers: -56 56
Do you want another operation: Yes
Enter two numbers: 58 15
Do you want another operation: Yes
Enter two numbers: 123 87
Do you want another operation: No
Output2: Sum = 466
Construct a Complex structure to represent a complex number with both real and imaginary components being real numbers. Request:
Write functions that calculate the sum, difference, product, and quotient of two complex numbers
Write a function that calculates the sum and difference of two complex numbers simultaneously.
Write a function that calculates the modulus of a complex number
Write a function that displays a complex number in the correct format (a+bj where a is the real component, b is the imaginary component)
Fibonacci sequence is defined with an integer n as,
F(n)=F(n-1)+F(n-2) for n ≥2,where F(0)=0,F(1)=1.
develop a Python program to compute F(n) for a given integer between 0 and 20.
Input: Output:
0≤n≤20 F(n)≤2 to the power32
Compute F(n) starting with n=2 and increment iteratively until the required value is obtained.
instructions-
Create a text file include the value ofn. The text file needs to saved in same folder
where the source file has been saved. The file name will be given as input through terminal.
Develop a function named“getNum"to read number n from file.
Develop a function named “show” to display the given value n and computed value
of F(n) on screen. (Expected output format Fibonacci(3) = 2)
Develop a function “saveFile” to write what was displayed in (3) above to a text
file named"result.txt”. This file should be in same folder where source file is.
program must call suitable functions to do the task.
if n>20 print invalid
Write C++ program to count the number of objects created and destroyed for a class using
static data members and static member functions.