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
Levart [38]
3 years ago
15

Write a program that gets a single character from the user. If the character is not a capital letter (between 'A' and 'Z'), then

the program does nothing. Otherwise, the program will print a triangle of characters that looks like this:
Computers and Technology
1 answer:
Sholpan [36]3 years ago
4 0

This question is incomplete. The complete question is given below:

Write a program that gets a single character from the user. If the character is not a capital letter (between 'A' and 'Z'), then the program does nothing. Otherwise, the program will print a triangle of characters that looks like this:

  A

 ABA

ABCBA

ABCDCBA

Answer:

#include <stdio.h>

void printTri(char asciiCharacter){

   // Row printer

//   for(int i = 65; i <= ((int)asciiCharacter); i++){

   int i = 65;

   while(i <= ((int)asciiCharacter)){

       int leftMargin = ((int)asciiCharacter) - i; +

       int j = 1;

       while(j <= leftMargin){

           printf(" ");

           j++;

       }

       int k = 65;

       while(k < ((int)i)){

           printf("%c",(char)k);

           k++;

       }

       int l = ((int)i);

       while(l >= 65){

           printf("%c",(char)l);

           l--;

       }

       printf("\n");

       i++;

   }

}

int main()

{

   for(;;){

       printf("Please enter a character between A and Z. Enter (!) to exit \n");

       char in;

//       scanf("%c",&in);

       in = getchar();

       getchar();

       printf("Printing Triangle for: %c \n",in);

       if(((int)in) >= 65 && ((int)in) <= 90){

           printTri(in);

           printf("\n");

       }else if(((int)in) == 33){

           break;

       } else {

           continue;

       }

   }

   return 0;

}

Explanation:

  • Inside the printTri function, print spaces, characters in order as well as characters in reverse order.
  • Inside the main function, take the character as an input from user then print the triangle by validating first to ensure that the character lies between a to z alphabets.
You might be interested in
Create a new method in your language called Times Print. This should be a void method. It should accept exactly two numeric valu
user100 [1]

Answer:

The code commented is given below, also the lines that start with # are comments that explains the code.

# Create a function named times_print that receives 2 values x and y

def times_print(x, y):

   # Print the formatted string

   print("The value of {} times {} is {}".format(x,y,x*y))

# Create the main function

def main():

   # Call the funciton times_print 3 times with different values

   times_print(2,3)

   times_print(4,5)

   times_print(5,6)

# Execute the main function

main()

Explanation:

The code was written using Python 3.5, and here I attach the screenshots of the program running:

8 0
3 years ago
Game development is a time-consuming and expensive endeavor, and being a Lone Ranger is a recipe for disaster
belka [17]
False although depends on the future of the person's ideas
7 0
3 years ago
How do you open the Font dialog?​
Simora [160]

Explanation:

Click the Home tab.

In the Fonts group, click the dialog box launcher button.

The button is found in the lower-right corner of the Font group.

The Font dialog box contains all the commands for formatting text, including quite a few that didn’t find their way into the Font group on the Ribbon. As with all text formatting, the commands you choose in the Font dialog box affect any new text you type or any selected text in your document.

When you’ve finished setting up your font stuff, click the OK button. Or click Cancel if you’re just visiting.

Use the Ctrl+D keyboard shortcut to quickly summon the Font dialog box.

hope my answer helps

pls mark this as brainlist

be sure to follow me and I will follow you back

stay safe

good day

6 0
2 years ago
Write a pseudocode algorithm to ask the user to input the name of a student, the marks he/she received in a test and the worth o
Luda [366]

Pseudocode algorithms are used as prototypes of an actual program.

The required pseudocode algorithm is as follows:

  • <em>Start</em>
  • <em>input name, score, test_worth</em>
  • <em>percent_score = score/test_worth * 100</em>
  • <em>print name, percent_score</em>
  • <em>Stop</em>

<em />

<em />

The first line begins the pseudocode algorithm

<em>Start</em>

The second line gets input for the student's name, score and the worth of the test

<em>input name, score, test_worth</em>

The third line calculates the percentage score

<em>percent_score = score/test_worth * 100</em>

The next line prints the student's name and the percentage score

<em>print name, percent_score</em>

The last line ends the pseudocode

<em>Stop</em>

<em />

<em />

<em />

Read more about pseudocode algorithms at:

brainly.com/question/21172316

4 0
2 years ago
Who should NOT apply for financial aid?
Gnoma [55]

Answer: wealthy students should, not a must, apply for it. Not every student.

7 0
3 years ago
Other questions:
  • During an investigation of a cybercrime, the law enforcement officers came across a computer that had the hard drive encrypted.
    5·1 answer
  • The _____ helps the project team to identify the main functions or features of the system and the different users or external sy
    15·1 answer
  • You have just finished writing a lengthy research paper and you are ready for formatting. You insert your paragraph headings and
    15·1 answer
  • Which of the following patterns of cell phone use can be observed in this chart
    12·1 answer
  • To reduce costs and the environmental impact of commuting, your company decides to close a number of offices and to provide supp
    14·1 answer
  • Which approach to knowledge management capitalizes on tacit knowledge and requires heavy IT investment?
    7·1 answer
  • What is the keyboard shortcut used to paste previously copied text?
    15·2 answers
  • Which is a benefit of traditional SLR cameras over digital cameras? A. They produce negatives to serve as backups. B. They make
    6·1 answer
  • Edhesive 9.10 Question 3
    13·2 answers
  • Explain what led to the invention of lasers
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!