Problem 5. a) Write a C++ function that inputs a text message and a positive integer k less than 26 and outputs an encrypted version of the message using the shift cipher with key k.
Q: a) f(x) - x{x-2) (x-1)(x+1) b) f(x) =-(x-2) (x-(*+1) O f(x) = -x{x-1)(x+)(x-2) ) flx) - (1-x)}(x+1)…
A: (a.) f(x) = x(x-2)2(x-1)(x+1) (b.) f(x) = -x(x-2)2(x-1)(x+1) (c.) f(x) = -x(x-1)(x+1)(x-2)2…
Q: Q) Write a C++ program to find the S (using function) S=( x*1/2! + x*3/4! + x*5/6!+...+ x*a/(a+1)!)
A: Use a function to find the factorial of a number and another function to find the sum of series The…
Q: 5-Write C++ program to find e from the following series: e = 1+x+ (x²/2!)+(x/3!)+... (x²/a!)
A: As per guidelines I can answer only first question. I hope you will understand. Thank You.
Q: Write C++ program to find the value of z under the following conditions x² +14x+2 x<0
A: code:-- #include <iostream>using namespace std; int main(){ // getting thw value of x…
Q: hat is the new value of a after execution of following code? Consi
A: option (B) is the correct option.
Q: Complete the output of the following C program. int i, v =10, *ip; while(i<=3){ V3DV+i: *ip++: ip…
A: Program #include <iostream>using namespace std;int main() { int i=1, v =10, *ip; while(…
Q: Write a C++ program to find the power fit y=Bx³ for the following data. Xk Yk 2.0 5.1 2.3 7.5 2.6…
A: According to the Question below the solution: Output:
Q: Write a C++ program to find the S S=(x*1/2! + x*3/4! + x*5/6!+...+ x*a/(a+1)!) Using (user defined…
A: Required:
Q: Write a complete C program to find X value. Use the repeated pattern to write an * efficient code A2…
A: The approach is to use power function by using values computed in the previous iteration initialize…
Q: Find and explain any two (2) differences between the following C++ programs. char ch='X'; char y=ch;…
A: Actually, c++ is a powerful general purpose language.
Q: 6- Write a C++ program to find W from the equations: :X>0,Y 0 X+ Y 2X +4X 3Y :X<0,Y =0 Print W for…
A: We are going to construct C++ code which will print values of W based on values of X and Y. We will…
Q: a) Write a C++ function that inputs a text message and a positive integer k less than 26 and outputs…
A: The steps to create the program are listed below. Create a function named encrypt that takes a…
Q: Write a code in Vb.Net to determine the value of function f(Z) from the-12 .equations below اكتب فقط…
A: Public Class Form1' to draw line take object lPrivate l As New List(Of String)Dim y, z, x, f As…
Q: Problem 4. (Decryption Program) Write a program called decrypt.py that accepts the private-key n…
A: - The given problem has required for the solution which is expected to provide a python program. -…
Q: Write an C program to read a value from PORT C, add value 33h. Send value to PORT B if value is…
A: Following needs to be done : Read value from PORT C Add 33h If value is greater than 99, send to…
Q: 11. Write a C++ program to input an integer n in the range 2-10 and then generate and print an…
A: Code: #include<iostream>using namespace std;main(){ int n,i,j; int a[11][11];…
Q: Write a C++ program that finds the value of W defined by the following equation: ((a + b) – 3)2 W =…
A: Start Input a, b, x, y Calculate w Print w Stop
Q: Write a FORTRAN program to calculate the derivate of the function; f(x)=-0.5x3+3x2-4x+1.5 Plz Help…
A: Below I have provided FORTAN Programming. Also, I have attached the screenshot of the code and…
Q: Write a C program to read inputs for m1, m2, G and r. Find value of F based on given formula and…
A: #include<stdio.h> int main(void) { int F,m1,m2,G,r; printf("Enter m1 value: ");…
Q: Write a c++ program to calculate xn without using pow function and take input x and n from user.…
A: We have xn = x*x*x* ------ n times. So, initialise a variable result 1 and inside a loop that runs n…
Q: Assume that X is the smallest non-zero digit in your student number and number (8 if it does not…
A: Given Student number: 123456 X is the smallest non-zero digit i.e. 1 Y is the largest even digit…
Q: Given an integer x, write a C++ function that prints the value of sin(x)*cos(x).
A: Given: An integer x. Requirement- Write a function that prints value of sin(x)*cos(x) Solution:…
Q: Write a C program to read inputs for m1, m2, G and r. Find value of F based on given formula and…
A: Start Input m1 Input m2 Input G Input r If r>0, Then calculate F Else print r value must be…
Q: 7. Write the contents of AH and BL after execution of the program. MOV AH,40h SHL AH, 01 MOV BL,80h…
A: AH=FE H, BL= C0 H SAR = It is used to shift the bits of byte/word towards right but instead…
Q: Q) Write a C++ program to find the S (using function) S=( x*1/2! + x*3/4! + x*5/6!+....+ x*a/(a+1)!)
A: Given sequence: S = (x*1/2! + x*3/4! + .... + x*a/(a+1)!)
Q: 2) Trace the following program MOV BX, 708ЕН MOV AX, BX MOV CX, 4802H OR BL, BH XOR BL, AH SHL BL,…
A: Given that: Trace the following program: MOV BX,708EH MOV AX,BX MOV CX,4802H OR BL,BH XOR BL,BH SHL…
Q: Write a C++ program to compute the volume of a cone using dynamic initialization feature. The volume…
A: Dynamic initialization feature is the ability to set or pass the values to the object of the class…
Q: Write C++ program to read x and compute the following. x+5x-20 2x if x>0 if x 0 x+(5x) 2-10 ifx<0
A: Here is Your Code #include <iostream>#include<math.h>using namespace std; int main(){…
Q: ### +######## Question 2 ####### #### ##1 ##### 2. Write a Python script that evaluates polynomails.…
A: Answer: The function for the polynomial with full code is given below with 1 as default value of x.…
Q: W\\ Write a c++ program to compute the following equation Y=xz+2/x²+4zx+2
A: Algorithm Start Variable x, y, z Accept value of x and z from user y = (x*z) +(2/(x*x) +(4*x*z) +2…
Q: { for (X=6; X<11; x++) Cout << 20-X <<"\t" << X<< endl; } int X;
A: Here is C++ code. This will print two list in column such as starting from 20- x= 20-6 = 14, 20-7=…
Q: Write a C++ program for the conversion of a decimal number to a binary, octal and hexadecimal…
A: PROGRAM CODE: #include <iostream>#include <cmath>#include <string>using…
Q: 1. Write the converse of the following: If you are happy, then you will sing. b) Convert (94A8)16 to…
A: The above question is solved in step 2:-
Q: Write a program in C to decrypt a cipher text using Caesar Cipher substitution method without a key…
A: Caesar Cipher substitution method can be defined as the encryption technique in which each letter is…
Q: Write a C++ function that inputs a text message and a positive integer k less than 26 and outputs an…
A: Based on C++
Q: Find the dual of the statement (xy) + (xz) O (x + ỹ) · (F + z) (x + y) · (x + z) (x + ỹ) · (x + z)…
A: In this question, we are asked the dual of the given statement. In dual, we just changed AND &…
Q: Write a short program that ignores SIGHUP and SIGKILL but responds with different messages when it…
A: According to the question , we have to write a short program for a signals according to given…
Q: Implement the following function using? a)8x1 MUX b)4x1 MUX F=ABC'+A'BC'+A'BC+AB'C
A:
Q: Write a script file using Conditional If-Elseif-Else statements to evaluate the following function,…
A: Objective: This program evaluates a given function by using conditional if-else if-else statements.…
Q: Q4 : Write C++ program to find and print the value of W using switch statement. ( 2X² + 5X + 3 W =…
A: Logic- pass the user choice to switch expression and set cases like -1, 0 and 1 . Also include…
Q: RSA problem: given plaintext P, e, prime numbers p, q, compute ciphertext C. Decrypt C and verify…
A: Let p = 3, q =11 n = p*q hence n = 33. Φ(n) = (P-1)(Q-1) Φ(n) = 20. Gcd(e,Φ) = GCD(3,20) = 1 ed…
Q: A-Write C++ program to read x and create a function named check to compute the following x²+5x-20…
A: Step 1: Declare real variable x and y Step 2: Accept value of x from user Step 3: Check x for…
Q: Qi write a C++ Program to find. the solution of the attached question COS(X)+4 :X=0
A: C++ program for above : #include <bits/stdc++.h> using namespace std; //function to…
Q: Write C++ program to read x and compute the following: x2+5x-20 2x if x >0 Y = if x = 0 x2 + (5x) 2…
A: Program: #include <iostream> #include <math.h> using namespace std; int main () {…
Q: Q2) Write a C++ program that finds the value of W defined by the following equation: ((a + b) – 3)2…
A: I have provided default values of a, b, x and y as an example to find the value of W using the given…
Q: Write a C++ program to compute the following via creating a function: N =n * (n-10) * (n-20) *…
A: In step 2, you will get the c++ code. In step 3, you can see the sample output.
Q: ou are tasked with calculating the cost of PCs for a new computer lab. Write a simple C++ program…
A: Program #include <iostream> using namespace std; int main(){ int n; float…
Q: 1- Write a C program for Arduino that controls a set of two traffic lights A & B at a crossroads.…
A: Here is the answer:-
(C++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Problem 5. a) Write a C++ function that inputs a text message and a positive integer k less than 26 and outputs an encrypted version of the message using the shift cipher with key k. b) Write a C++ function that inputs a positive integer k less than 26 and a text message encrypted using the shift cipher with key k and outputs a decrypted version of the message. c) Write a C++ program to test your functions from parts a) and b). Note: While working on this problem, assume that each text message consists of capital letters and spaces only. For Problem 5, submit your C++ program and test results. Make sure to test your program several times.Question 5 Develop a single program using Python.a. Encrypts and decrypts a message using the Cesar’s Cipher. The user encrypting the message is prompted to enter a message and then a key that indicates the displacement. The user decrypting the message is prompted to enter the encrypted message and the key. b. Decrypts and displays all (26) possible solutions.Write a C++ function that will find the cost to send an international fax. The service charge is $7.00. It costs $0.45 per page for the first ten pages and $0.10 for each additional page. Take as parameter the number of pages to be faxed, and calculate the total amount due. The total amount due is returned to the main program.
- Question 2: Encryption is a process to secure your data. Caesar Cipher is one of the method to encrypt the data. In this method we need a key to encrypt data. Now using that key one character is replaced with another one. [small or capital alphabets are allowed, otherwise invalid input] Write a C++ program in which, read a character and an integer key from user. Now encrypt the character using given key. Example 1: Sample input: Enter a character: a Enter key: 3 Sample output: Encrypted character is: d Example 2: Sample input: Enter a character: Z Enter key: 3 Sample output: Encrypted character is: C Example 3: Sample input: Enter a character: @ Enter key: 3 Sample output: Invalid input1. Write a C++ program which prints using + the first 3 letters of your last name. For instance, if your last name is Hendricks you will print HEN as follows HEN .. 2. Write a C++ program with the main() function as follows: - ask the user Enter numbers for temperature in Kelvin: - use the formula .k – 459.67 to compute the corresponding temperature in Fahrenheit degrees - print a message of the sort 300 degrees Kelvin = 80.33 degrees Fahrenheit 3. Write a C++ program as follows: - write the function double distance( double x1, double y1, double x2, double y2 ) which takes 4 parameters for the coordinates of 2 points compute and returns the distance between the 2 points (71, y1) and (x2, Y2) (using the Pythagorean Theorem) d = V(11 – 12)² + (y1 – 42)² write the main() function with a while loop where - - ask the user Enter 4 numbers at a time x1 y1 x2 y2: - use the function distance to compute and print the corresponding distanceTASK 1:Write a C++ program that takes an integer from user and check whether the number is even or odd using bitwise operators. TASK 2:Write a C++ program that takes an integer from user and check whether the number is power of 2 or notusing bitwise operators. TASK 3:Write a C++ program that takes an integer from user and check whether the number is multipleof 4or notusing bitwise operators. TASK 4:Write a C++ program that takes an integer from user and check whether the number is divisbleby9or notusing bitwise operators. the answer to be in c++ language.
- create a c++ program that will solve for this problem A jogger starts a course at a steady rate of 8 kph. Five minutes later, a seconds later, a second jogger starts the same course at 10 kph. How long will it take for the second jogger to catch the first?Exercise 2: Write a C++ program which receives the input for a,b,c and perform the operation x= [a?+ ( b5- TT)- Vc] and obtain the result. Use the constant value 3.14159 for TTI. Exercise 3: Write a C++ program that receives in the radius of a circle as input and generate the output for circle's diameter, circumference and area. Use the constant value 3.14159 for T. Diameter (D) Area (A) = 2*R = TT* R? Circumference (C) %3D = 2* TT*R %3D Variables: R, D, A and C.Q2/Write a program with a specific programming language to insert a user program into memory and allocate locations for it using Reg Fence once and use relocatio again e 1:41 Q3/Apply that if the program is 5kb, 22kb, or 40kb, what will happen in the implementation of C ++ language 2 1:41
- Need help with this c++ problem In encryption, plain text is the normal, human-readable text. Cipher text is the encrypted message. These are the two functions you'll be writing. One will encrypt plain text and the other will decrypt cipher text. void cipher(istream& in, ostream& out, unsigned key)void plaintext(istream& in, ostream& out, unsigned key) You are going to read from the parameter in and write to the parameter out. Treat the two parameters, in and out, just as you would cin and cout. In fact, if you want to encrypt the characters you type from the keyboard, and have the output appear in the console, you can just call cipher(cin, cout, 5) from your run function and everything that you type will be shifted to the right by five characters. Both of these functions are filter functions, so they will use data loops. Here is the pseudocode for the cipher() function: cipher(in, out, key):read each character (c) from inshift the character c right by keywrite c to out…Please use C++ In this lab, you need to write a program which, given a seven digit binary input given below, it will check to see if there is a single bit error using the Hamming Code method discussed in lab. For a sample of Hamming Code, the input: 1110101 will reveal that ‘110’ is the location of the error (meaning the sixth slot in the input), so the corrected number would be 1010101, and the actual message transmitted, would be 1011, which is 11 in decimal. You can use this example to test your program to ensure it’s working correctly. Create a program which can, given a 7-bit long input, written in Hamming Code style, do the three following tasks, displaying the results as output. (1) Determine if there’s an incorrect bit, and if so, where it is. (2) Display what the CORRECT code should look like (if it needs to be corrected.) (3) Display the decimal form of the message that was sent, after any needed correction. Remember, when using Hamming…1. Write a C++ program that reads a positive integer and prints all of its binary digits (in reverse order). Print the number % 2, then replace the number by number / 2. Keep going until the number is 0. Validate the input. Do not accept a negative integer. Sample run of program: Enter a positive integer: > -2 Invalid input! > 20 Your number in binary in reverse order is: Try again: