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
Oxana [17]
3 years ago
10

One method of encoding messages is known as the "expanding square code". this method encodes message by placing the character of

the message in an odd order square matrix row by row, and then retrieving them in a clockwise expanding square spiral from the center of the matrix. if the message is not exactly the right length to fill the matrix, the rest of the matrix is filled with asterisk characters (*). for example, the two square matrices below show the order in which the characters are placed in the matrix, and the order in which they are retrieved. notice that the order of retrieval begins at the center, then proceed to the right, and then spirals clockwise order in order out 1 2 3 4 5 21 22 23 24 25 6 7 8 9 10 20 7 8 9 10 11 12 13 14 15 19 6 1 2 11 16 17 18 19 20 18 5 4 3 12 21 22 23 24 25 17 16 15 14 13 message in: "this is a test message!!" message out: "stssees a a*!!egmtithis " your program must be able to encode messages by this method. the input (from standard in) will consist of a string of text entered by the user, containing an unknown number of characters n (0 < n <= 1000). from the length of the message, you should determine the minimum odd order required for the matrix, and perform the specified operation. the output for you program will be the encoded message.
Computers and Technology
1 answer:
mars1129 [50]3 years ago
4 0
Wow!! that is ALOT of info,I dont think i could help with this one Umders 699 maybe someone else can sorry that i couldn`t help :)
You might be interested in
Why is iot architecture important?
Harlamova29_29 [7]
They need to make sure your building is easy to move around in. Beyond the building itself, architecture and design can help bring balance to people's lives. ... Well-designed schools create better learning environments. Workplaces with good architecture experience higher productivity.
7 0
3 years ago
Robert's computer is not starting due to an error in the BIOS. Which of these chips could have malfunctioned? Select the correct
timofeeve [1]

Hi;

In the question, Robert gives the explanation that there is an error in the BIOS. A BIOS (Standing for Basic Input & Output System) is a ROM chip, and is vital for the computer to initialize devices such as RAM, the CPU, etc. If there is ever an error there, a computer simply cannot boot.

From the options given, your answer given would be C. ROM.

I hope this helps!

8 0
3 years ago
Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
Viktor [21]

Answer:

The program to this question can be given as:

Program:

import java.util.*;

//import package for user input  

class Main     //define class

{

public static void main(String a[])  

//define main function

{

int positive_number=0,negative_number=0,count=0,num; //define variable

double total=0,avg=0;  

//creating Scanner class object.

Scanner ob = new Scanner(System.in);

System.out.println("Enter an integer, when done input 0: "); //message

num= ob.nextInt();

//taking input from user

if (num==0)  //check number equal to 0  

{  

System.out.println("No numbers are entered except 0"); //message

System.exit(1);

}

else

{

while (num!= 0)  

{    

   if (num> 0)

   {

positive_number++; // Increase positives

}

else

{

negative_number++; // Increase negatives

}

total=total+num; // Accumulate total

count++;    // Increase the count

num=ob.nextInt();

}

// Calculate the average

avg=total/count;

// Display values

System.out.println("The positive number is:"+positive_number);

System.out.println("The negatives number is:"+negative_number);

System.out.println("total is:"+total);

System.out.println("average is:"+avg);

}

}

}

Output:

Enter an integer, when done input 0: 22

2

1

4

0

The positive number is:4

The negatives number is:0

total is:29.0

average is:7.25

Explanation:

In the above program firstly we import the package for user input then we define a class that is main in this class we define the main method in the main method we define variable. Then we create a scanner class object for user input. In the number variable, we take multiple inputs from the user and also check that the user does not insert 0 at the starting of the program. To check this we use the condition statement that is a number equal to 0 then it will terminate the program. In the else part we first declare the loop that checks that inserted number is positive and negative and in this, we calculate the total of the numbers and at the end of the loop, we calculate the average of the number and print all the values.

4 0
3 years ago
Read 2 more answers
The library Wi-Fi kiosk requires a symmetric connection to the Internet. Which WAN technology would probably be the least expens
kenny6666 [7]

Answer:

The answer is IP-sec.

Explanation:

0.75 miles of range is a low distance for a WAN (Wide Area Network) so a point-to-point WAN tehcnology such as IP-sec or SD-WAN can be preferred. But the least expensive option would be choosing IP-sec as specified in the question.

I hope this answer helps.

6 0
3 years ago
Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to
Alik [6]

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

8 0
2 years ago
Other questions:
  • Assume that word is a variable of type String that has been assigned a value. Assume furthermore that this value always contains
    13·2 answers
  • Which type of electronic community displays discussions on different topics in threads?
    8·1 answer
  • Why aren’t I leveling up? I have enough points and even a brainliest. Could an expert please help me!! I am really confused.
    10·1 answer
  • Janice, who is 15, posts post a picture of herself drinking alcohol and making an obscene gesture on her social network page. wh
    15·2 answers
  • Engineers at Edison Laboratories developed a _____ strip that allowed them to capture sequences of images on film.
    14·2 answers
  • . A store offers a deposit of 6% on the cash price of $462. The deposit amount is?​
    6·1 answer
  • You are going to visit a national park, and have never been there before. You are using a map to try and make the distance trave
    11·1 answer
  • One of the benefits of holding an investment for over a year rather than selling it in less than a year is that the
    14·2 answers
  • A musician has recorded some initial ideas for new songs which she wishes to share with her bandmates. As these are initial idea
    7·1 answer
  • A. A set of electronic program that makes of computer perform tasks
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!