Please write with simple codes
Q: 1. Find the error in each of the following code segments and explain how to correct it. a) x = 1;…
A: a) Here the loop goes into an infinite loop as x=1 and 1<=10 is always true and the value of x is…
Q: 3. Write LC3 code to set R5 from R3, according to the following formula: R5 = 2*R3 + 2 %3D
A: we have to write LC3 code which is a machine code or assembly language which is executed by the the…
Q: Find the sum 2+4+6+8+10+12 using sum and the .colon operator
A: Write the matlab code which calculates the following sum using sum and colon operator: 2+4+6+8+10+12
Q: fix the error
A: Given programming language is matlab
Q: List all the permutations of (a, b, c). (Click to select)
A: In permutation, The position of elements matters the most. The number of elements given to us is 3…
Q: addition of two number using C programming need the code
A: Given question about addition of two number using C programming Algorithm: 1. Start 2. Read two…
Q: write 9 Pseudo Code for finding The grestest of 3 numbers represented as A‚B, and C
A: Given:
Q: Evaluate the postfix expression A B C D + * / Where A = 66, B = 1, C = 12 and D=10
A: Following is an algorithm for evaluation postfix expressions. 1) Create a stack to store operands…
Q: Using compound assignment operators compute the sum, difference, product and quotient of two…
A: Step 1: Ask for inputs from the user Step 2: Calculate sum, difference, product, and quotient…
Q: Analyze the code below: for i in range(1, 1): for j in range (1, 2): print( 3, end= 4
A: i represents the row and j represents number of #'s that has to be printed in each line # is printed…
Q: please do part a AND b
A: Answer is given below-
Q: return (2) when input number is even 5/7
A: Required: Note: we are only allowed to solve one question in one post. to get answers to others,…
Q: Please reduce the λ expression so that it is in normal form: (λa.a(λa.b a)) (λc.c
A: According to the question we need to: Reduce the λ expression so that it is in normal form:
Q: In dual-code assignment, two codes appear in the Alphabetic Index. This is to signal to the coder…
A: Dual Code: In order to learn more, the dual coding learning technique is all about using various…
Q: Please give c++ code for this pseudo code
A: For printing, we have to use cout
Q: Take input a number from user and print if the number is fibonacci number or not. IN C++
A: The answer is...
Q: Print specific number of the substrings use c# code
A: The answer is
Q: f the numbers (+9,742)10 and (+641)10 are in signed-magnitua 5(+10,383)10 and requires five digits…
A: The signed magnitude format of decimal numbers is represented as follows: (+9742)10 and (+641)10 In…
Q: Find the maximum value between 1000 numbers. print the numbers from 1 to 1000. Find the summation of…
A: Here flowchart is given and using that we have to find that what it will print.
Q: Given the following expression, Z= [(G+E) * A] – [H * (A + S / L)] i. Convert the expression to…
A: A postfix expression is one in which the operator is placed after the operand
Q: When N=50 above code prints
A: push function adds the element at the top of stack pop function removes the element from top of…
Q: 4. It could add and subtract numbers up to eight digits.
A: Given: Which tool used for calculating numbers upto 8 digits.
Q: Sketch the flowchart for computing the factorial of (N) where N!-(1x2x3x4x5x6x7x..xN) represented…
A:
Q: 6- Using g(p) =p³ + p² + 1, find the output codeword for [D]=[0011] and [D]=[0010]
A: 1) Convert the polynomial into binary form. g(p) =p3+p2+1 [G] = [1101] 2) Add r 0's as LSB to data…
Q: f T, for the reference
A: Given as,
Q: Use your code to compute e-0.3 H.
A: Below is the complete solution to calculate e-0.3. By using exponential function exp() method in…
Q: This program segment display th sum of the series [ 9 + 99 + 999 + 9999.....] for only ten terms.…
A: Answer the above question are as follows
Q: Print the integers from a to b with 2 increments (reguest a and b from the user and make sure that…
A: #include<iostream> #include<iomanip> using namespace std; int main() { int…
Q: Find the error(s) in the following code segments and fix them: int count = 1; while (count <= 10);…
A: Given, int count =1; while(count<=10); number++; let's find out the errors from the…
Q: matches any characters except "a", "b" and "c". Write the regular
A: Introduction A regular expression is a kind of expression that is demonstrated to implement certain…
Q: Fill in the blanks Ob) this code mean.....
A: OB Code is a feature within the dashboard that allows marketers to set automated rules on their…
Q: Please try to generate 7 random integers between 101 and 999999 which is divisible by 11 in python
A: Required:- Please try to generate 7 random integers between 101 and 999999 which is divisible by 11…
Q: 1. Use if - else - elif Read 3 numbers from the user and check the following. () If the 1st number…
A: # As no language is mentioned, so the program is written in Python language. num1 =…
Q: check If the number is divisible by 5 or nc
A: Please find the answer below :
Q: What is the Probability of error in REpitition code,huffman code.
A: Huffman code for the most part is a method used for information compression. Huffman algorithm…
Q: Use your code to compute the following:
A: #include<iostream> using namespace std; // method to find GCF using Euclidean algorithm int…
Q: Write the c++ code according to the following algorithm insert 1357 using forloop and then while…
A: The code is given below.
Q: B, C are squai
A: Q
Q: operator gives the value 7 when 56 and 8 are given as inpu
A: Please find the answer below :
Q: What is the output of this code segment when the input value of X equal 100.
A: Out of range
Q: Cpp write a code segment to print the numbers between 2 to 20 that are divisible by 4 without…
A: Given: Cpp write a code segment to print the numbers between 2 to 20 that are divisible by 4 without…
Q: Write a c++ code to convert decimal to hexadecimal
A: Actually, binary no's are nothing but a 0,s and 1's.
Q: using C++ , please show steps
A: Given:
Q: Pick the first four numbers of your index number eg. 0401 if index number is 04011212 45 ii. 654 ii.…
A: Given :
Q: Find the error(s) in the following code segments and fix them: While ( sum <= 1000 ) cout << "adding…
A: The problem is based on the basics of loops in C++ programming language.
Q: Modify the given R programming code to print numbers only upto 5.
A: The given code prints numbers from 1 to 10 using a while loop. To modify the code to print numbers…
Q: write a code segment to print the numbers between 2 to 20 that are divisible by 4 without remainder
A: Program description: l is the user input integer variable that stores the lower limit of the range…
Please write with simple codes
Step by step
Solved in 3 steps with 2 images
- Creat a class reversit and Write a function called reversit () that reverses a C-string (an array of char). Use a forloop that swaps the first and last characters, then the second and next-to-last characters, and so on. The string should be passed to reversit () as an argument. Write a program to exercise reversit (). The program should get a string from the user, call reversit (), and print out the result.by using c++(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 inclusive using initializeArray (from question 1) and counts the occurrence of each number in the array and graphs the information in the form of a bar chart or histogram—each number is printed, then a bar consisting of that many asterisks is printed beside the number. Here is a sample run of the program: Number Value Histogram 1…(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 using initializeArray (from question 1) and counts the occurrence of each number in the array and prints the occurrences. Note: Print time or times correctly. Hint: Declare another array called count that stores the number of each value as you count the numbers of the original array. Use printArray (from question 1) to print the values of count. Here is a sample run of the program: 1…
- a) Write a c++ program which contains a function isPalindrome, the function checks a stringusing pointers whether it is a palindrome or not and based on the decision return Ture orFalse. A string/word that reads the same backwards as forward is known as palindrome.E-g MADAM , POP , BOB etcb) Write a program that takes a char array (char *) that take your name as input, a charpointer point it and convert lower to upper and vice versa.In C++ >>> Write a program that prompts the user to enter 50 integers and stores them in an array. The program then determines and outputs which numbers in the array are sum of two other array elements. If an array element is the sum of two other array elements, then for this array element, the program should output all such pairs separated by a ';'. An example of the program is shown below: list[0] = 15 is the sum of: ---------------------- list[1] = 25 is the sum of: list[5], list[14]; list[13], list[47]; list[46], list[47]; ---------------------- list[2] = 23 is the sum of: list[0], list[33]; ---------------------- list[3] = 65 is the sum of: list[4], list[32]; list[13], list[20]; list[20], list[46]; list[21], list[34]; list[32], list[38]; ---------------------- list[4] = 34 is the sum of: list[0], list[14]; list[6], list[48]; ---------------------- list[5] = 6 is the sum of: ... If no two elements can equal the value of an element, the line can remain empty, as shown above…In C++ Declare a constant “ SIZE = 5 ” Declare an array of ints , of size SIZE . Initialize that array to have the values 10, 12, 15, 19, 6 . – Write a loop that calculates and prints out the minimum value of the array. – Write a loop that calculates and prints out the maximum value of the array. – Write a loop that calculates and prints out the average value of the array.
- Topic: pointers, dynamic array and command line arguments Write a complete C++ program named “showHelp” that accepts command line arguments. It checks whether there is a command line argument of “/help” or“/?” or “-help” followed by a topic number. It will print out “yes, topic number(<number>) if there is one. Otherwise, it prints out “no, topic number(N/A) For example, if you run this program with correct arguments as follows, it willprint out yes and its associated topic number respectivelyshowHelp /? 101showHelp /debug /help 102showHelp /print /help 103 /verboseshowHelp -verbose -debug -help And if you run the program with invalid arguments, it will print no, in all casesshowHelp -helpshowHelp 101 /?showHelp 101 102 /help /verboseshowHelp /? /help -helpNote: command line arguments are simply an array of pointers to C-string. example code: #include <iostream> using namespace std; int main(int argc, char** argv){...}C Program Calloc Write a program that asks for two integers X and Y as input and creates two arrays with sizes X and Y using calloc. Then, ask for the elements of the two arrays using a loop of your preference and concatenate the two arrays into one. Elements in X must come first. One line containing an integer for the size of the array X Print the concatenated elements inside a pair of square brackets [ ] where each elements are separated by a comma and a space. At the end of the program, don't forget to free the memory space. Input 1. One line containing an integer for the size of the array X 2. One or more lines containing an integer for the elements of array X 3. One line containing an integer for the size of the array Y 4. One or more lines containing an integer for the elements of array Y Output Enter size of array 1: 3 Enter element 1: 1 Enter element 1: 2 Enter element 1: 3 Enter size of array 2: 2 Enter element 1: 4 Enter element 1: 5 [1, 2, 3,…Question Write a program to create an answer sheet to read the student’s answers for a ten (10) item exam. It should then display a message indicating the score and remarks whether the student passed or failed the exam. (A student must correctly answer 6 of the 10 questions to pass the exam.) Here are the correct answers (key to correction), which should be initialized and stored in an array: TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE What I need is a C++ program and must use array of strings.
- Exercise 1: Write a program that generates a sequence of 20 random values between 0 and 99 in an array, prints the sequence, sorts it, and prints the sorted sequence. Use the sort method from the standard Java library. Exercise 2: Write a program that stores a list of countries: "Egypt", "Switzerland", "Argentina", "Spain", "Portugal", "Luxemburg", etc. Initialize your array with a single statement. Then print out the array. Use the sort function as before to sort the countries in alphabetical order. Reprint your array. Exercise 3: Implement exercises 1 and 2 using ArrayList. Use the Collections.sort method for sorting. After you have printed and sorted your results, then append an additional element to each list and reprint your ArrayLists. Notice that the new items will appear just at the end and will not be sorted. Resort and print out the new ArrayLists again. To clarify, you should print out your ArrayLists after your first sort, after adding items with the…Q3. Write a c++ program that inputs 10 numbers from user in an array, then check even, odd and prime numbers and separate them in other arrays respectively. Display all arrays. (CLO-2) #C++Using C Language write a program: An instructor gives a multiple choice test which consists of 5 questions, each of which is answered by a choice of one of the numbers one to five. Write a program to call function TEST that accepts as input student name and the set of their test answers as one dimensional array. The program should grade the test. If the student choice is 1 give 1 point. If the choice is 2, give 2 points. 3 points if choice answer is 3 and 4 pints for answer 4 and choice 5 is 5 points. Otherwise no point is given to other choices. Print out the average score of the student in the test.SAMPLE RUN 1:INPUT : Enter student name : LYNNEEnter Answer # 1? 2Enter Answer # 2? 3Enter Answer # 3? 5Enter Answer # 4? 5Enter Answer # 5? 4OUTPUT : LYNNE, your total score is 19 and your average score is 3.8.SAMPLE RUN 2:INPUT : Enter student name : ROSEEnter Answer # 1? 2Enter Answer # 2? 3Enter Answer # 3? 767Enter Answer # 4? 5Enter Answer # 5? 4OUTPUT : ROSE, your total score is 14…