473,812 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generating a Christmas Tree in C++/C#

3 New Member
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.
Dec 13 '07 #1
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?
Dec 13 '07 #2
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.)
Dec 13 '07 #3
viperman5000
3 New Member
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.
Dec 13 '07 #4
viperman5000
3 New Member
(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.
Dec 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1794
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)
2
8621
by: suppaduppa | last post by:
to print christmas tree using c++
3
2557
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.
2
2251
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
4
4025
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...
2
4279
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...
8
3430
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
0
1675
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...
0
2358
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...
0
9734
marktang
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...
0
9607
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,...
1
10417
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,...
0
10139
tracyyun
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...
0
9219
agi2029
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...
1
7677
isladogs
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...
0
5568
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...
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.