1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
adell [148]
3 years ago
6

The Atbash Cipher encrypts messages by reversing lowercase letters, so ‘a’ becomes ‘z’, ‘b’ becomes ‘y’, ‘c’ becomes ‘x’, etc...

Also, any space or punctuation mark gets repeated. For example, hello human! encrypts to svool sfnzm!! Encrypt msg and save the answer to a variable called encrypted (you don’t have to display anything). Note: msg will only have lowercase letters, punctuation and spaces. msg = input('Enter secret message: ', 's');
Engineering
1 answer:
jarptica [38.1K]3 years ago
3 0

Answer:

See Explanation Below

Explanation:

// Program is written in C++ Programming Language

// Comments are used for explanatory purpose

// Program starts here

#include<iostream>

#include <bits/stdc++.h>

using namespace std;

int main()

{

// Declare 2 string variables to store the secret message and to store the encrypted text

string message, result;

// Prompt user to enter a secret message

cout<<"Enter a secret message: ";

cin>message;

// Convert the input string to char array

int n = message.length();

char char_array[n + 1];

strcpy(char_array, message.c_str());

// Initialise result

result = "";

// Declare an array of all possible alphabets a-z

char possible[26] = { 'a','b','c','d','e','f','g,','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',w','x','y','z'};

// Generate output string

// Start by getting string position

int count = 0;

while(count<n)

{

// If current character is blank or !

if(char_array[count] = '!' || char_array[count] = ' ')

{

result+=char_array[count];

}

else

{

for(int I = 0; I<26; I++)

{

if(char_array[count] = possible[I])

{

result+=possible[25-I];

}

}

}

count++;

}

// No output required; the program stops here

return 0;

}

// End of program

You might be interested in
Germanium forms a substitutional solid solution with silicon. Compute the number of germanium atoms per cubic centimeter for a g
brilliants [131]

Answer:

The number of germanium atoms per cubic centimeter for this germanium-silicon alloy is 3.16 x 10²¹ atoms/cm³.

Explanation:

Concentration of Ge (C_{Ge}) = 15%

Concentration of Si (C_{Si}) = 85%

Density of Germanium (ρ_{Ge}) = 5.32 g/cm³

Density of Silicon (ρ_{Si}) = 2.33 g/cm³

Atomic mass of Ge (A_{Ge})= 72.64 g/mol

To calculate the number of Ge atoms per cubic centimeter for the alloy, we will use the formula:

No of Ge atoms/cm³=[Avogadro's Number*C_{Ge}]/([C_{Ge}*A_{Ge}/ρ_{Ge})+(C_{Si}*A_{Ge}/ρ_{Si})]

                              = (6.02x10²³ * 15%) / [(15% * 72.64/5.32)+(72.64*85%/2.33)]

                              = (9.03x10²²)/(2.048+26.499)

                              = (9.03x10²²)/(28.547)

No of Ge atoms/cm³ = 3.16 x 10²¹ atoms/cm³

3 0
3 years ago
Two gears that are directly touching are called?
MAVERICK [17]

Answer:transmission

Explanation:

i’m not entirely familiar with this but i’m sure it’s transmission!

3 0
3 years ago
Using only the sequential operations described in Section 2.2.2, write an algorithm that gets two values: the price for item A a
suter [353]

Answer:

total_cost = cost + tax

Explanation:

Step1) Let the 2 variable for take input from user e.g price and quantity

var price ;

var quantity ;

var cost ;

var tax ;

var total_cost ;

Step2) take input from user quantity of item 'A'

step3) cost = price * quantity

Step4) tax = 0.08 * cost

Step5) total_cost = cost + tax

Step6) print the total_cost

7 0
3 years ago
An equilibrium mixture of 3 kmol of CO, 2.5 kmol of O2, and 8 kmol of N2 is heated to 2600 K at a pressure of 5 atm. Determine t
garri49 [273]

Answer:

x_{CO}=0.0203\\x_{O_2}=0.0926\\x_{CO_2}=0.227\\x_{N_2}=0.660

Explanation:

Hello,

In this case, we consider the reaction:

CO(g)+\frac{1}{2} O_2(g)\rightleftharpoons CO_2

For which the law of mass action is expressed as:

Kp=\frac{n_{CO_2}}{n_{CO}*n_{O_2}^{1/2}} (\frac{P}{n_{Tot}} )^{1-1-1/2}

Whereas the exponents are referred to the stoichiometric coefficients in the chemical reaction. Moreover, in table A-28 (Cengel's thermodynamics) the natural logarithm of the undergoing reaction at 2600 K is 2.801, thus:

K=exp(2.801)=16.46

In such a way, in terms of the change x the equilibrium goes:

16.46=\frac{x}{(3kmol-x)*(2.5kmol-0.5x)^{0.5}} (\frac{5}{13.5kmol-0.5x} )^{-0.5}

Hence, solving for x:

x=2.754kmol

Thus, the moles at equilibrium:

n_{CO}=3-2.754=0.246kmol\\n_{O_2}=2.5-0.5(2.754)=1.123kmol\\n_{CO_2}=x=2.754kmol\\n_{N_2}=8kmol

Finally the compositions:

x_{CO}=\frac{0.246}{0.246+1.123+2.754+8} =0.0203\\\\x_{O_2}=\frac{1.123}{0.246+1.123+2.754+8} =0.0926\\\\x_{CO_2}=\frac{2.754}{0.246+1.123+2.754+8} =0.227\\\\x_{N_2}=\frac{8}{0.246+1.123+2.754+8} =0.660

Best regards.

7 0
4 years ago
Risks in driving never begins with yourself, but with other drivers who take risks.
Alexxx [7]

Answer:

I'm gonna go with A) FALSE. just seems more realistic

4 0
3 years ago
Read 2 more answers
Other questions:
  • A mixing basin in a sewage filtration plant is stirred by a mechanical agitator with a power input/WF L T=. Other parameters de
    8·1 answer
  • A 0.5 m^3 container is filled with a mixture of 10% by volume ethanol and 90% by volume water at 25 °C. Find the weight of the l
    13·1 answer
  • a steal bar with 1 in diameter has been subjected to a tensile force of 3 tons find tensile stress in the bar
    14·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • How did engineers help to create a ceiling fan
    8·1 answer
  • In what particular setting is this used or prepared?​
    13·1 answer
  • What type of treatment is Dr. Wayne experimenting on?
    14·1 answer
  • How should you move your board through the planer? (Pick two choices.)
    8·1 answer
  • State two reasons why industrial files must be always be used fitted upon the individual
    8·1 answer
  • X − 3y − 8z = −10 2x + 5y + 6z = 13 3x + 2y − 2z = 3
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!