Question

Help write in pseudocode? ASCII Art. Computer graphics were really awful when Personal Computers first came...

Help write in pseudocode? ASCII Art. Computer graphics were really awful when Personal Computers first came to market. In fact, many computers would show spreadsheets and even full video games using only ASCII characters (look up Nethack, Angband, or even Medievia). We’ll start the beginning of your ASCII Art career by drawing squares that are based on user input. Write a function called drawBox that takes in number representing the width of the square. In main, ask the user for a number and then “draw” a box of that size by calling that function. There are several ways to code this, but you must have one function that you call from main. If you create additional functions that are called from that function, you’re that much more powerful! Hint #1: this is done by drawing individual characters. Hint 2: drawing the top and bottom lines are the same. How would you draw just the second line of Sample Run #3 below? Hint 3: a size of 1 is a special case… Your task is to design (pseudocode) and implement (source code). For the source code, name your class “A5_1” and put it into a file called “A5_1” (either .java, .cs or .cpp)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

using System;

class MainClass {

public static void Main (string[] args) {

Console.Write("Enter the size of the box: ");

int n=Convert.ToInt32(Console.ReadLine());

for(int i=0;i<n;i++){

for(int j=0;j<n;j++){

// TO PRINT THE TOP LINE

if(i==0||i==n-1)

Console.Write("* ");

// TO PRINT LEFT AND RIGHT LINES

else if(j==0 || j==n-1)

Console.Write("* ");

else

//PRINTING MIDDLE SPACES

Console.Write(" ");

}

Console.WriteLine("");

}

}

}

/*

PSEUDOCODE

DECLARE SIZE

READ SIZE

LOOP I=0 TO SIZE

LOOP J=0 TO SIZE

IF I==0 OR I==SIZE-1

PRINT("* ")

ELSE IF J==0 PR J==SIZE-1

PRINT("* )

ELSE

PRINT(" ")

END LOOP

PRINT("\n")

END LOOP

*/

Note : Please comment below if you have concerns. I am here to help you

Please post other questions in separate post as per policy we have to answer 1 question per post. Please post separately .Thank you

Add a comment
Know the answer?
Add Answer to:
Help write in pseudocode? ASCII Art. Computer graphics were really awful when Personal Computers first came...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ code please asap QUESTIONS Write the test main function as described next. This function is...

    C++ code please asap QUESTIONS Write the test main function as described next. This function is NOT a member function of either of the two classes above. It is located in separate source file. Create an array of type Flight and size 10 1. Prompt the user to enter values for speed, name, and id for all 10 objects. You must use the overloaded input stream operator of class Flight. 1. Write the value of the name variable of all...

  • How do i write the pseudocode for this java code? First, write out pseudocode, and then create a program to help you by accomplishing the following tasks: :  Use command line interface to ask the use...

    How do i write the pseudocode for this java code? First, write out pseudocode, and then create a program to help you by accomplishing the following tasks: :  Use command line interface to ask the user to input the following. ○ How many apples are on hand ○ How many apples should be in stock ○ How many oranges are on hand ○ How many oranges should be in stock  Perform an operation to determine how many of...

  • Game Description: Most of you have played a very interesting game “Snake” on your old Nokia...

    Game Description: Most of you have played a very interesting game “Snake” on your old Nokia phones (Black & White). Now it is your time to create it with more interesting colors and features. When the game is started a snake is controlled by up, down, left and right keys to eat food which appears on random locations. By eating food snake’s length increases one unit and player’s score increases by 5 points. Food disappears after 15 seconds and appears...

  • 1) Echo the input: First, you should make sure you can write a program and have...

    1) Echo the input: First, you should make sure you can write a program and have it compile and run, take input and give output. So to start you should just echo the input. This means you should prompt the user for the plaintext, read it in and then print it back out, with a message such as "this is the plaintext you entered:". [4 points, for writing a working program, echoing the input and submitting the program on the...

  • Objective: Write a program that implements the Game of Life cellular automata system invented by John...

    Objective: Write a program that implements the Game of Life cellular automata system invented by John Conway. 1. Create two game grids of size at least 50x50. These grid cells can be either Boolean or integer. In the following, I’ll refer to these as gridOne and gridTwo. 2. Set all cells in both grids to false. 3. Start by initializing gridOne. Allow the user to specify two different ways of initializing the grid: 1) by specifying a pattern file to...

  • Read this article. Then write a 250 word response on two of the programs you like...

    Read this article. Then write a 250 word response on two of the programs you like the most. Open source business intelligence software 1. BIRT BIRT is an open source BI program that CloudTweaks says is often viewed as the industry standard. BIRT boasts “over 12 million downloads and over 2.5 million developers across 157 countries.” Its users include heavyweights such as Cisco, S1, and IBM (which is also a BIRT sponsor). They also have maturity going for them, as...

  • C++ please Programming Assignment #6 Help Me Find The Secret Message Description: This assignment will require...

    C++ please Programming Assignment #6 Help Me Find The Secret Message Description: This assignment will require that you read in an encrypted message from a file, decode the message, and then output the message to a file. The encryption method being used on the file is called a shift cipher (Info Here). I will provide you with a sample encrypted message, the offset, and the decrypted message for testing. For this project I will provide you main.cpp, ShiftCipher.h, and ShiftCipher.cpp....

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT