Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a message by a given amount. For example, if your rotate by 3, every A becomes D; every B becomes E; and so on. Toward the end of the alphabet, you wrap around: X becomes A; Y becomes B; and Z becomes C. Your program should prompt for a message and an amount by which to rotate each letter and should output the encoded message.

Answers

Answer 1

Answer:

Here is the JAVA program that produces Caeser cipher o given message string:

import java.util.Scanner;  //to accept input from user

public class Main {  

   public static void main(String args[]) {  //start of main function

       Scanner input = new Scanner(System.in);  //creates object of Scanner

       System.out.println("Enter the message : ");  //prompts user to enter a plaintext (message)

       String message = input.nextLine();  //reads the input message

       System.out.println("Enter the amount by which by which to rotate each letter : ");  //prompts user to enter value of shift to rotate each character according to shift

       int rotate = input.nextInt();  // reads the amount to rotate from user

       String encoded_m = "";  // to store the cipher text

       char letter;  // to store the character

       for(int i=0; i < message.length();i++)  {  // iterates through the message string until the length of the message string is reached

           letter = message.charAt(i);  // method charAt() returns the character at index i in a message and stores it to letter variable

           if(letter >= 'a' && letter <= 'z')  {  //if letter is between small a and z

            letter = (char) (letter + rotate);  //shift/rotate the letter

            if(letter > 'z') {  //if letter is greater than lower case z

               letter = (char) (letter+'a'-'z'-1); }  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //compute the cipher text by adding the letter to the the encoded message

           else if(letter >= 'A' && letter <= 'Z') {  //if letter is between capital A and Z

            letter = (char) (letter + rotate);  //shift letter

            if(letter > 'Z') {  //if letter is greater than upper case Z

                letter = (char) (letter+'A'-'Z'-1);}  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //computes encoded message

           else {  

         encoded_m = encoded_m + letter;  } }  //computes encoded message

System.out.println("Encoded message : " + encoded_m.toUpperCase());  }} //displays the cipher text (encoded message) in upper case letters

Explanation:

The program prompts the user to enter a message. This is a plaintext. Next the program prompts the user to enter an amount by which to rotate each letter. This is basically the value of shift. Next the program has a for loop that iterates through each character of the message string. At each iteration it uses charAt() which returns the character of message string at i-th index. This character is checked by if condition which checks if the character/letter is an upper or lowercase letter. Next the statement letter = (char) (letter + rotate);   is used to shift the letter up to the value of rotate and store it in letter variable. This letter is then added to the variable encoded_m. At each iteration the same procedure is repeated. After the loop breaks, the statement     System.out.println("Encoded message : " + encoded_m.toUpperCase()); displays the entire cipher text stored in encoded_m in uppercase letters on the output screen.

The logic of the program is explained here with an example in the attached document.

Write A Program That Produces A Caesar Cipher Of A Given Message String. A Caesar Cipher Is Formed By
Answer 2

In this exercise we have to use the computer language knowledge in JAVA to write the code as:

the code is in the attached image.

In a more easy way we have that the code will be:

import java.util.Scanner;

public class Main {  

  public static void main(String args[]) {

      Scanner input = new Scanner(System.in);

      System.out.println("Enter the message : ");

      String message = input.nextLine();  

      System.out.println("Enter the amount by which by which to rotate each letter : ");  

      int rotate = input.nextInt();  

      String encoded_m = "";  

     char letter;  

      for(int i=0; i < message.length();i++)  {

          letter = message.charAt(i);

          if(letter >= 'a' && letter <= 'z')  {  

           letter = (char) (letter + rotate);  

           if(letter > 'z') {  

              letter = (char) (letter+'a'-'z'-1); }

           encoded_m = encoded_m + letter;}  

          else if(letter >= 'A' && letter <= 'Z') {

           letter = (char) (letter + rotate);  

           if(letter > 'Z') {  

               letter = (char) (letter+'A'-'Z'-1);}

           encoded_m = encoded_m + letter;}  

          else {  

        encoded_m = encoded_m + letter;  } }

System.out.println("Encoded message : " + encoded_m.toUpperCase());  }}

See more about JAVA at brainly.com/question/2266606

Write A Program That Produces A Caesar Cipher Of A Given Message String. A Caesar Cipher Is Formed By

Related Questions

Suppose you have a class Ship, which was written by another programmer who used to work for your employer. Ship is used in several different applications. Ship contains a public method called getBearing() that consults gyroscopes and a compass to determine the direction in which the ship is moving and returns a Location object. You need to refactor the code to use a GPS receiver instead. You should

Answers

Answer:

Research of the GPS features and the modules and packages needed by the programming language to implement and receive data from a GPS tracker.

Explanation:

The Ship class is a blueprint that holds a data structure of a ship's location in coordinates. The location variable can be changed using the getBearing method and an instance of the ship class can be made several times for different ships in the harbor. This class depicts the power of object-oriented programming.

Refactoring is a concept in software engineering where source codes are modified to achieve code efficiency and speed. All programming language source code should be refactored where needed with the right packages or modules.

Explain demand paging with a proper example

Answers

Demand paging :

In computer operating systems, demand paging (as opposed to anticipatory paging) is a method of virtual memory management. In a system that uses demand paging, the operating system copies a disk page into physical memory only if an attempt is made to access it and that page is not already in memory (i.e., if a page fault occurs). It follows that a process begins execution with none of its pages in physical memory, and many page faults will occur until most of a process's working set of pages are located in physical memory. This is an example of a lazy loading technique.

What benefits does the Domain Name System (DNS) provide? Check all that apply.
Network Address Translation (NAT)
Ease of address memorization
Assigning Internet Protocol (IP) addresses
Easy mapping to a new Internet Protocol (IP) address

Answers

Answer:

Option C (Assigning Internet Protocol (IP) addresses) is the correct choice.

Explanation:

DNS is a centralized process for resolving as well as continuing to give IP addresses for something like a specified domain name, a method that allows you to search a site via your web browsers whenever you tab or switch on any web server (Internet Explorer, chrome, respectively.).This helps everyone to still have throughput mostly on the network although one of the databases becomes offline for maintenance.

All other options are not relevant to the situation in question. It is the right answer to all of the above.

Answer:the TCP

Explanation:

Which color reflects more light red blue black or white

Answers

White black absorbs the light

Choose the two statements that best describe the relationship between HTTP and the World Wide Web

Answers

Answer:

(I) and (III)  statements that best describe the relationship between HTTP and the World Wide Web.

Explanation:

Given that,

The following statements that is describe the relationship between HTTP and the World Wide Web

(I). HTTP and WWW are used in website.

(II).  World Wide Web are not interlinked by hypertext.

(III). WWW is the system of connected hypertext documents that can be viewed on web browsers.

We know that,

HTTP :

The full form of HTTP is Hypertext Transfer Protocol . A protocol  which permits the getting of plans it is called HTTP.

For example : HTML documents.

It is an application of a protocol where any data exchange on the Web.

It is a protocol of online communication and data transfer one system to another system.

WWW :

The full form of WWW is world wide web. It is used as a web which is information systems where documents and other web methods are checked by uniform resource locators, which may be interlinked by hypertext.

It is a collection of webpages.

Hence, (I) and (III)  statements that best describe the relationship between HTTP and the World Wide Web.

edhesive 1.7 code practice question 1
Fix the error so that the code works correctly
input (“Enter a number: “)
print (num * 8)
How do I fix the error?

Answers

Answer:

num = int(input("Enter a number: "))

print(num * 8)

Explanation:

I highlighted the parts that are added

Since you are getting an input from the user, you need to set the result to a variable. In this case, it is num.

Since it is a number, you need to specify the its type. In this case, it may be int.

Also, the quotation marks must be written as seen.

The corrected program which ensures that the program runs correctly is written thus :

num = int(input("Enter a number: ")

#user supplied input should be assigned to the varibale num

print(num * 8)

#multiplies num by 8 and displays the output.

The num variable in the second line isn't attached to any value, therefore, it will throw an error.

The user input value should be attached to the variable, 'num'

The second line of code multiplies num by 8 and displays the product.

Therefore, if the the user input is 3 ; the final result displayed will be : (3 × 8) = 24.

Learn more :https://brainly.com/question/15566254

Research and a well-written problem statement are important because A)they give a clear understanding of the problem and its solution. B)they ensure that anyone in the general public will be able to understand and solve the problem. C)they give a list of the needs of the stakeholders. D)they ensure that questions still need to be asked about the problem.

Answers

Answer:

A. they give a clear understanding of the problem and it's solution

Explanation:

Research and a well-written problem statement are important because they give a clear understanding of the problem and its solution.

Answer:

Research and a well-written problem statement are important because

they give a clear understanding of the problem and its solution.

they ensure that anyone in the general public will be able to understand and solve the problem.

they give a list of the needs of the stakeholders.

they ensure that questions still need to be asked about the problem.

A furniture rentingstore rents severaltypes of furnituretocustomers.It charges a minimum fee for the first month. The store charges an additional fee every monthin excess of the first month. There is amaximum charge forany givenyear. Write a program that calculates and prints the chargefor a furniturerental.

Answers

Incomplete question. Attached is an image of the full question.

Explanation:

The best program to use is MS Excel. By using the Summation formula MS excel we can derive the difference in sales for the two years.

Plzz helps me with hw

Answers

Answer:

1. not statistical

2. statistical

3. statistical

4. not statistical

5. statistical

6. not statistical

7. statistical

Explanation:

The statistical can compare more then 1 thing to make it reasonable.

In an inspection, usually the first thing an inspector will want to see is:

Answers

Answer:

Your records and paperwork

Your paperwork, your skills, and your background/ record.

The primary reason for networking standards is to: Group of answer choices simplify cost accounting for networks ensure that hardware and software produced by different vendors can work together make it more difficult to develop hardware and software that link different networks ensure that all network components of a particular network can be provided by only one vendor lock customers into buying network components from one vendor

Answers

Answer:

ensure that hardware and software produced by different vendors can work together.

Explanation:

Networking standards can be defined as a set of rules and requirements for data communication which are necessary for the inter-operation of network devices (hardware) and software application processes.

Hence, the primary reason for networking standards is to ensure that hardware and software produced by different vendors can work together. This ultimately implies that, networking standards makes it possible for various vendors and manufacturers to develop or produce networks that avail users the ability and opportunity to share informations and communicate with one another easily.

Some examples of organizations responsible for creating networking standards are;

1. International Telecommunications Union— Telecommunications (ITU-T).

2. International Organization for Standardization (ISO).

3. American National Standards Institute (ANSI).

Additionally, the generally accepted standards for networking are; HTML, HTTP, IMAP, POP, SNMP, SMTP, TCP etc.

_________ attacks are becoming less common in modern operating systems.
a. Denial of service
b. SYN flood
c. Buffer overflow
d. None of the above

Answers

Answer:

c. Buffer overflow

Explanation:

In Computer programming, buffer can be defined as an area of memory set aside specially and specifically for holding data or informations.

A type of exploit that relies on overwriting contents of memory to cause unpredictable results in an application is known as buffer overflow. This ultimately implies that, buffer overflow is the process of exceeding the storage capacity of a memory buffer with data, beyond the amount it is designed to hold and therefore overwrites any adjacent memory locations.

Buffer overflow attacks are becoming less common in modern operating systems because the modern operating system usually leaves a space between buffers and randomize the layout of memory through call mapping, as well as through the use of runtime protection.

Proper numeric keyboarding technique includes all of these techniques except
O keeping your wrist straight
O resting your fingers gently on the home keys
O looking at the keys
O pressing the keys squarely in the center

Answers

The answer is looking at the keys

Answer: Its the 1st choice, 2nd choice, and the final one is the 4th one. (NOT the third answer choice)

Explanation: (I just took the test)... Hopefully this helps and good luck.

Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that are applicable.

require the network administrator or computer support technician to manage the system from a client workstation that has the right tools installed on it
work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX
are designed for very large networks and have strong multitasking capabilities
provide a graphical user interface that makes it easier for network administrators to learn the system
use wizards and setup devices as the user operating system, making it easier to set up network features

Answers

Answer:

The answers are -

work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX

provide a graphical user interface that makes it easier for network administrators to learn the system

use wizards and setup devices as the user operating system, making it easier to set up network features

Explanation:

Windows Server operating systems are a popular choice for a network because they work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX, provide a graphical user interface that makes it easier for network administrators to learn the system. The correct options are B and D.

What is operating system?

An operating system (OS) is the program that controls all other application programs in a computer after being installed into the system first by a boot program.

Through a specified application program interface, the application programs seek services from the operating system (API).

The main job of an operating system (OS) is to control files and directories.

The management of files on a computer is the responsibility of the operating system. File creation, opening, shutting, and deletion all fall under this category.

Because they run on networks that use Windows operating systems as well as Mac OS, NetWare, or UNIX, Windows Server operating systems are a common choice for a network.

They also offer a graphical user interface that makes it easier for users to navigate

Thus, the correct options are B and D.

For more details regarding operating system, visit:

https://brainly.com/question/6689423

#SPJ2

if you exit a program without saving the document on which you are working, or the computer accidentally losses electrical power, the document will be lost

Answers

Depends on which program you are using. Some programs automatically save your work, even if you exit out of it or turn off your computer

which of the following is another term for a variable, such as cost or schedule, that limits the freedom of design, development, or manufacture of a product?

Answers

Answer:

constraint

Explanation:

What is considered to be the core of the Unix operating system ?

Answers

Answer:

My lips

Explanation:

Just kidding what is that?

Complete the statement below with the correct term.

A single-mode
uses a single ray of light, called a mode, to transmit data.

Answers

Answer:

Its Fiber

Explanation:

Trust me

Answer:

Data transfer through the core using a single light ray (the ray is also called a mode).

The core diameter is around 10 microns.

At distances up to 3 km, single mode delivers data rates up to 10 Gbps.

Cable lengths can extend a great distance. Or FIBER

Explanation:

hope this helps

A disadvantage to using open source software is

it may restrict your ability to customize the software to suit your needs.

a higher level of technical skill may be required to install, use, or modify it.

you will need to find the developers who created the software to request their permission to reuse the source code.

you can use the software only if you make a donation to an open-source nonprofit organization

Answers

Answer: a higher level of technical skill may be required to install, use, or modify it.

Explanation:

Answer:

B. a higher level of technical skill may be required to install, use, or modify it.

Explanation:

Which statement is true about the purpose of a work in process constraint?

Answers

The available options are:

A. It identifies possible constraints for Solution completion.

B. It helps analyze, approve, and track Portfolio Epics and Enablers.

C. It captures where all new "big" ideas come from.

D. It encourages collaboration and enables

Answer:

It identifies possible constraints for Solution completion

Explanation:

Work in Process is an activity or operational related term that describes a form of self-assigned restriction by a team or organization to aid them in regulating their responsibility, exercise corporate reasoning, and recognize alternatives for lasting development.

Hence, in this case, considering the available option, the correct answer is that Work in Process " identifies possible constraints for Solution completion."

The statement is true about the purpose of a work in process constraint is that it identifies possible constraints for Solution completion.

The WIP limits is often called the work-in-process limits. They are known as fixed constraints. it is implemented on Kanban boards, and it aids teams actively to remove waste from their processes.

It also helps teams to optimize their workflows for value delivery.

The WIP limits is used in agile development as it set the maximum amount of work that can exist in each status of a workflow.

Learn more from

https://brainly.com/question/15395767

The full question is below

Which statement is true about the purpose of a work in process constraint?

The options to the question are:

A. It identifies possible constraints for Solution completion.

B. It helps analyze, approve, and track Portfolio Epics and Enablers.

C. It captures where all new "big" ideas come from.

D. It encourages collaboration and enables

Which of the following is used to encrypt web application data?
a. MD5
b. AES
c. SHA
d. DHA

Answers

Answer:

b. AES

Explanation:

AES is an acronym for Advanced Encryption Standard and it is a cryptographic or symmetric block cipher that is based on a substitution-permutation network (SPN) used for the encryption of sensitive data over the internet or web. AES uses a key length of 128, 192 or 256 bits and a block length of 128 bits to encrypt data on web applications.

It is an encryption standard of the government of the United States of America and is supported by the National Institute of Standards and Technology (NIST).

Hence, AES is used to encrypt web application data and it uses an algorithm developed by Vincent Rijmen and Joan Daemen, known as the Rijndael algorithm.

How is a Creative Commons license different from a regular copyright? As a reminder, in the warm-up we saw the this scenario: ----------------------------------------------------------------------------------------------------------------------- Imagine you were using some of our pixelation tools to create an image and you posted it online for your friends to see - but, a week later you find out someone took that image and put it on a T-shirt that they’re selling for $10 each. -------------------------------------------------------------------------------------------------------------------- Now that we understand Copyright, what would need to change in order for the scenario from the warm-up to be okay?

Answers

Explanation:

You need to change the whole thing and do it differently.. And register it.

The thing that'll need to be changed in order for the scenario from the warm-up to be okay is to create a creative common license which will  give room for people to be able to use my work and sell items that have my work on them.

In this case, the creative commons license enables one to share copyrighted work easily. It should be noted that intense protections are put on a work when the work is copyrighted.

With the creative common, a person can allow others use their work as long as the person abide to rules.

In conclusion, creative common allows one have control of one's work.

Read related link on:

https://brainly.com/question/

Which of the following HTML structures arranges text in multiple rows and columns?
a.
b.
c.
d.

Answers

Answer:

b. <table>

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations of a web page to be displayed.

A <table> is a HTML structure that arranges text in multiple rows and columns. Other data that can be arranged into rows and columns in a HTML table are images, links, and other tables. Each row in a table is denoted with a <tr> tag.

what is the color of red?

Answers

Answer:

red

Explanation:

orange and red

Answer: Red

Explanation: The reason why it's red is because of how we see colors through our eyes.

How has technology influenced space exploration?

Answers

Answer:

One of the biggest benefits of machine learning when it comes to space exploration is that programs can sift through the available data more easily than humans, which increases the chance of finding planets just by looking at datasets. It's even thought that AI could be instrumental in locating extra-terrestrial life.

Explanation:

Why are problem-solving strategies important? Choose all that apply. ensures important factors are taken into consideration ensures everyone involved in the solution understands the steps that are being taken makes it possible to find all solutions makes it possible to repeat the process to refine the solution DONE​

Answers

Answer:

A,B,D

Explanation:

Answer:

A: ensures important factors are taken into consideration

B: ensures everyone involved in the solution understands the steps that are being taken

D: makes it possible to repeat the process to refine the solution

Question 4
When something is saved to the cloud, it means it's stored on Internet servers
instead of on your computer's hard drive.

Answers

Answer:

Wait is this a question or are you for real

Answer:it is stored on the internet server instead

of your computer's hard drive.

Explanation:

the cloud is the Internet—more specifically, it's all of the things you can access remotely over the Internet.

Create a Boolean function odd_number_digits(n) that returns True when a positive integer has an odd number of digits. (You may assume that I will not use a number greater than 1,000,000.) Then, use it to make a
function sum_odd_digits(n) that sums all the numbers from 0 to n that have an odd number of digits.

Answers

Answer:

Following are the code to this question:

import java.util.*;//import package for user input

public class Main//defining class main

{

   public static boolean odd_number_digits(int n)//defining boolean method odd_number_digits

   {

       if(n>0 && n%2!=0)//defining if block that check value is positive and odd number

       {

       return true;//return value true

       }

       else//defining else block

       {

           return false;//return false value

       }

   }

   public static void  sum_odd_digits(int n)//defining a method sum_odd_digits

   {

       int sum=0,i;//defining integer variable

       for(i=0;i<=n;i++)//defining for loop

       {

           if(i%2!=0)//defining if block for odd number

           {

               sum=sum+i;//add odd number

           }

       }

      System.out.print(sum);//use print method to print sum value

   }

public static void main(String[] args) //defining main method

   {

       Scanner ox=new Scanner(System.in);//creating Scanner object

       int n= ox.nextInt();//defining integer variable for input value

       System.out.print(odd_number_digits(n)+ "\n");//use print method to call method

       System.out.println("Sum of odd numbers: ");//print message

       sum_odd_digits(n);//calling method

   }

}

Output:

please find the attachment.

Explanation:

In the above code, two methods "odd_number_digits and sum_odd_digits" are defined in which the first method return type is boolean because it will true or false value, and the second method returns the sum of odd numbers.

In the "odd_number_digits" method,  an integer variable passes as an argument and inside the method, if block is used that check value is a positive and odd number then it will return a true value.

In the "sum_odd_digits" method, it accepts an integer parameter "n", and define integer variable "sum" inside the method, which uses the for loop, inside the loop if block is used that counts odd numbers and adds its in sum and print its value.

What is meant by computer generation?​

Answers

Answer:

The development of computer took place into 5 phases which is known as generation of computer.

Explanation:

From first generation computer till now, development of computer took place in 5 distinct which is also know as generation of computer.

Answer


Generation in computer terminology is a change in technology a computer is/was being used. Initially, the generation term was used to distinguish between varying hardware technologies. Nowadays, generation includes both hardware and software, which together make up an entire computer system.

Chunking is a good strategy for completing large assignments because it makes the work
O less boring.
more thorough.
less difficult
O more manageable.

Answers

I think it would be the fourth answer choice.

Answer:

D. more manageable

Explanation:

it wouldn't make the work less boring, wont make work less difficult and and it wont help u get more through quicker

Other Questions
An external reward is known as extrinsic motivation..TrueOB. False Determine what kind of solution you would expect from the system of equations 3x - 8y = 10 and 16x - 32y = 75 without graphing the system. Explain how you determined your answer. What is the approximate difference in the elevation between austin and the hill country just to the west Izzy is calculating the amount of time it takes a rocket to get to the moon. The moon is around 239,000 miles from Earth. How many hours would it take a rocket that can travel at 500miles per minute to travel to the moon? Round to the nearest hour8 hours20 hours478 hours28,680 hours 30 pts and will mark brainiest!one advantage of first person point of view in speeches and texts is:a. the speaker creates a distant tone with the audienceb. the speaker creates a personal tone with the audiencec. the speaker does not have to tell the truthd.the speaker does not have to know anything about the intended audience 6(2x-3)-8=-2Solve for x! Tyy Compared to the Indian policies pursued by the other English colonies in theseventeenth century, Pennsylvania employed an Indian policy that wasSelect one:O a. fairer and more respectful in both theory and practice.O b. at least as brutal and exploitative.O c. fairer in theory but brutal and exploitative in practice.O d. considerably more brutal and exploitative in every way. can u help me if u don't mind tbh tho Which statement is a main idea of Mesmerized?Franklin and Dr. Mesmer have very little in common.Since the American Revolution, France has been a strong ally of the United States.Franklin travels by boat to France to advise the king. Because the king of France respects Franklin, he asks him to investigate Dr. Mesmer. What do most psychologists believe to be the cause of development? A. a familys socioeconomic status B. interaction of nature and nurture C. only due to nurture D. only due to nature HELP PLZ I WILL GIVE U 10 POINTSS A class has 6 boys and 14 girls. What is the ratio in simplest form? A mans age today is three years less than four times the age of his oldest daughter,Let a represent the daughters age.Write an equation to match the scenario. square root of 229.7 What happened after the War forIndependence? which graph represents The solution to6x-2x5X +7 HELP ME PLEASE IM CRYING Evaluate the expression for p = 4. 3p2 18(2 p) = What challenges cell biologists face in the 21st century? best way to graduate high school fast