Using for loops, how would you generate a Christmas Tree using *'s. Also, the size depends on the user's input (size). Any help would be greatly appreciated, as my grade depends on it.
4 9802 sicarie 4,677
Recognized Expert Moderator Specialist
What language (C++ or C#, specifically) are you using, and what have you done on this so far?
oler1s 671
Recognized Expert Contributor
Using for loops, how would you generate a Christmas Tree using *’s.
I would first actually pick a language. Then I would type up the code in my IDE. Then I would compile it. And then run the program.
Any help would be greatly appreciated, as my grade depends on it.
Ok, good luck then. I hope my wishing you luck helps.
(If you don’t want to attract even more advice of this kind, read the forum rules about dumping homework on us.)
I'm using C#, but from what I understand, they are very similar.
So far, I have:
for (int i = 0; i < size; i++)
{
for (int n = 0; n < i; n++)
{
Console.Write(" *");
}
Console.Write(" ");
Console.Write(" \n");
}
Right now, it's just a tree but it's left-justified. I have a feeling it's something to do with formatting issues.
(If you don’t want to attract even more advice of this kind, read the forum rules about dumping homework on us.)
Sorry. I apologize. Thanks though.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Xah Lee |
last post by:
# -*- coding: utf-8 -*-
# Python
# David Eppstein of the Geometry Junkyard fame gave this elegant
# version for returing all possible pairs from a range of n numbers.
def combo2(n):
return dict()
print combo2(5)
|
by: suppaduppa |
last post by:
to print christmas tree using c++
|
by: Thorsten Kampe |
last post by:
Hi,
This is a fairly general question: is there some kind of module or
framework that allows building a tree like structure from certain kind
of data?
To be specific: I have a program that dumps the content of a LDAP
directory including all properties and values and groups the result
from the LDAP search by objClass.
|
by: Prasad |
last post by:
This was our earlier design
<Product Inventory Info>
<Company>
<Make>Computer General</Make>
<Model>Wizbang 1900</Model>
It was later found that <Product Inventory Infohad spaces in
between. It was later decided that it has to be of the following
format
|
by: mexicandayworker |
last post by:
I have this problem I have to program with vb2005.
Write a program to calculate the 12 days of christmas. The program requests an integer from 1 to 12 and then lists the gifts for that day along with the cost. The program should also give the costs for all 12 days ($72,608.00). If bad data is supplied the program should display a message box to the user and NOT perform any calculations. If the data is good the calculations should be performed...
| |
by: rednarjess |
last post by:
Hello every body;
When I want to generate the Javadoc for my project,
The result is fine at the bigining of the generating
init:
Generating Javadoc
Javadoc execution
Loading source file D:\workspace\JavaApplication4\src\javaapplication4\Main.java...
Constructing Javadoc information...
Standard Doclet version 1.6.0
Building tree for all the packages and classes...
|
by: Bert |
last post by:
How can my response to this problem be better? The pot doesn't work
that well when you enter 25, 21, 17 and some others.
The problem:
CHRISTMAS TREES
The grade 5 class at the local primary school wants some Christmas
tree outlines to colour in for the break-up session. You have to
write a program which will ask for an odd number representing the size
|
by: Now You Know |
last post by:
Best Christmas Lights Decoration Sale Installation in Los Angeles
818-386-1022
(These types of Innovative lights will definetly add to your Christmas
decor)
Here are the tips to use:
The most common color combinations appropriate for the Christmas
season include red, green and copper lights that denote festivity;
blue and green lights for more subdued arrangements; novelty
combinations such as blue and red lights; and mauve, blue and...
|
by: Now You Know |
last post by:
Best Christmas Lights Decoration Sale Installation in Los Angeles
818-386-1022
(These types of Innovative lights will definetly add to your Christmas
decor)
Here are the tips to use:
The most common color combinations appropriate for the Christmas
season include red, green and copper lights that denote festivity;
blue and green lights for more subdued arrangements; novelty
combinations such as blue and red lights; and mauve, blue and...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |