Using visual studio (C#) to create a program, name it PRGYOURNAMEFA1, that implements a search and replace function recursively. Your program should allow a user to enter a string , a substring to be replaced in the entered string and a character/s to replace the found substring
Program Structure
1. A main class that implements the logic of the program – name this class TestSearchReplace
2. Add a class named SearchReplace to the main class with two methods, including:
a. SearchSubstring()- return method
b. ReplaceSubString() - void method
The two method should be called using an object in the main class. DONT CREATE THE TWO METHODS IN THE MAIN CLASS
Improve the source code from class lecture (see the starter code) to display error messages if the user enters non numeric values. Also, the program needs to present the user with an error message if the initial deposit is more than their financial goal ($10,000).
Note: In order to get full credit for this exercise, you need to:
Sample Program Run:
Enter your initial deposit $:
Your initial $1800 needs 287 years to mature to $10020.6
Another Sample Program Run:
Enter your initial deposit $:
Invalid input!
Please enter your initial deposit (less than $10K):
Invalid input!
Please enter your initial deposit (less than $10K):
Invalid input!
Please enter your initial deposit (less than $10K):
Your initial $6123.88 needs 82 years to mature to $10001.4
Write an application that allows the user to select from a menu a checking account (1) and a savings account (2) (The balance of these two account should be generated automatically by the program within this range 1 to 100 rand and stored into an array ). Compare the two balances and Display the message “Checking account balance is low” if the checking account balance is less than R10 do the same for the saving account. Again, display the message “Savings account balance is lower or greater then the checking account and visa versa . Save the file as Balance.java.
1. Use of a random function
2. use of an array to store the generated balance
3. use of an if statement
4 . Display of correct output
Given a list of different right and left foot shoes, write a python code to return the exact number of shoe pairs which can be formed from the given list. Also, return how many number of shoes of which foot are required to form pairs with the unpaired shoes.
Input Format
Input_list = ['R','L','L','R','R',R','R,'L']
Constraints
.
Output Format
Paired: 3
Unpaired: 2
Required left Shoes
Sample Input 0
8
L R L L R L R L
Sample Output 0
Paired: 3
Unpaired: 2
Required right shoes
Sample Input 1
9
R L R L R R L R R
Sample Output 1
Paired: 3
Unpaired: 3
Required left shoes
Sample Input 2
6
R R R R R R
Sample Output 2
Paired: 0
Unpaired: 6
Required left shoes
Sample Input 3
8
L L R L R R L R
Sample Output 3
Paired: 4
Unpaired: 0
Given the following student data:
image
Write a Python code to print('Welcome student name') if both username and password entered by user match for that student. Note: Check first username and then password
Input Format
Username: 122
Password: Ghi122
Constraints
i) If entered username is not present in the list of usernames, then print Enter a valid username
ii) If entered password is not present in the list of passwords, then print Password Incorrect
iii) If both username and password belong to the same student, then print Welcome student_name
iv) If username and password do not belong to the same student, then print Username and password do not match
Output Format
Output: Welcome Ghi
Q1) Write a Python program to find the list of reverse of the elements in the given list would be prime number.
Input Format
[ 74, 5, 33, 79, 12, 56]
Constraints
1.If there is no prime number in the given list then print**('No prime number')**
Output Format
List of prime numbers: [74, 5, 79]
(or)
No prime number
Write a function which prints the fine for breaking traffic rules. The function should take two parameters: Speed and Helmet.
Input Format
helmet = 0 (worn)
helmet = 1 (not worn)
speed = 60 km/hr
Constraints
Speed limit = 60 km/hr
Rules:
1. If speed > speed limit and helmet is worn, then fine = Rs 1000;
2. If speed <= speed limit and helmet is not worn, then fine = Rs 2000;
3. If speed > speed limit and helmet is not worn, then fine = Rs 5000;
4. If speed <= speed limit and helmet is worn, then print 'No Fine'
Output Format
Fine: Rs 1000
(or)
No Fine
Create a java program that will count all words in a sentence. The program should have a minimum of two classes.
a) The first class should be named class1, this class will have the following:
The main method (starting point)
The object of class2
Should also call the get method count_words(String str).
b) The second class should be named class2, this class should have the following:
A constructor
A get method named count_words(String str)
c) Construct a flowchart for class1 and class2 both combined
An e-commerce company plans to give their customers a special discount for the Christmas They are planning to offer a flat discount. The discount value is calculated as the sum of all the prime digits in the total bill amount.
Write an algorithm to find the discount value for the given total bill amount.
Implement a class Sequence to store a sequence of non-negative integer values, and the length of the sequence. The class has the following private data members:
1. int length – the length of the sequence
2. int *pseq – a pointer to a dynamic integer array holding sequence of integer:
1.Sequence() – a default constructor that initializes length to 10 and store the sequence of all zeros in an array.
2. Sequence(int lengthVal, int n1=0,int n2=0,int n3=0, int n4=0, int n5=0, int n6=0, int n7=0, int n8=0, int n9=0, int n10=0) –
3. Sequence(Sequence &s) –
4. int getLength() – a getter for length
5. int* getSeq() – a getter for the sequence of numbers
6. void Sort(int n) –
7. int RemoveDuplicates() –
8. void Rotate(int steps) – a method that rotates the sequence elements clockwise for the
9. ~Sequence() – a destructor to deallocate the dynamically created array