473,890 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C Sharp Programming

2 New Member
I am a very new programmer. Trying to solve this problem.

Create a static function called Part1 with the following signature:

public static void Part1()

Call this function from the file's Main function. In Part1 write some code that writes the following pattern to the console:

*
++
***
++++
*****
++++++

Don't just write 6 calls to Console.WriteLi ne! Use 2 nested for loops, one for each line and one for each character on the line. Use a conditional (if) statement to determine if the line number is even or odd, so that you know which character to use for the line. (Hint: use the modulus operator, %).
Sep 18 '07 #1
1 1383
nateraaaa
663 Recognized Expert Contributor
I am a very new programmer. Trying to solve this problem.

Create a static function called Part1 with the following signature:

public static void Part1()

Call this function from the file's Main function. In Part1 write some code that writes the following pattern to the console:

*
++
***
++++
*****
++++++

Don't just write 6 calls to Console.WriteLi ne! Use 2 nested for loops, one for each line and one for each character on the line. Use a conditional (if) statement to determine if the line number is even or odd, so that you know which character to use for the line. (Hint: use the modulus operator, %).
Post the code that you have written so far. Also this sounds like homework.

Nathan
Sep 18 '07 #2

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

Similar topics

50
4342
by: Jerry Sievers | last post by:
<venting> Fellow coders; I just get off the phone today with some clueless headhunter and after listing for her (very proudly I might add) my OS and dev tools platforms of choice; Linux/Apache/Postgres/PHP I get a few moments of silence and she mentiones to me some new wizzy
20
7391
by: The LoxFather | last post by:
Coming from a VB background, which should .NET language should I learn....C++ or C Sharp. Is C++ going to be dead soon?
12
3223
by: Sybren Stuvel | last post by:
Hi there! I'm a beginning Python programmer, and I like it a lot already. Since my Sharp Zaurus has a fairly complete Python environment including PyQT, I thought it would be the perfect language for programming some nice things on my Zaurus. The thing I really missed on the Z was a good Jabber client. That's why I'm building my own. Things are going good, and in a few nights I've been able to get a fairly decent though under-featured...
4
2519
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got hard time to understand vb syntax. I don't know if anyone in here can point out which is the equivalent object used in c sharp. Translate these two lines to C sharp: Sub Next_Click(Sender As Object, e As EventArgs) Select Case...
1
4641
by: Khan | last post by:
Hi i am doing gps programming but dont know how to start is there any builtin facility avaialable in c sharp or i have to use third party libraries. i need a sample code which can lead me to start the programming thanks
0
1153
by: Robert Kent | last post by:
We just got our 500th member. Check it out. http://groups.yahoo.com/group/c-sharp-programming/members -- Bill Cousert bill@cousert.com www.cousert.com
3
1261
by: Dallas Dahms | last post by:
Hi. Is C Sharp the way to go for learning dotnet programming, or would VB.net be equally as rewarding to learn? My experience is limited to BASIC and PYTHON programming. Thanks. Dallas
2
2155
by: Maury | last post by:
Do you know if somewhere exists the conversione of Vb.Net 'My' class (or better My.Computer.Network.Ping) in C Sharp? Thanks M.A.
20
2634
by: windandwaves | last post by:
Hi Folk I am a PHP programmer, but I like to learn c-sharp as it seems to be in hot demand around here. My questions are: - how does c-sharp relate to PHP - do you like c-sharp and its cousins - are there better things to do then c-sharp? Thanks a million
3
2414
by: Gandalf | last post by:
Sharp effect is one of the photoshop effect on letters. some one a javascript script that create the same effect? thanks
0
9977
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...
1
10910
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
10452
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...
1
8009
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
5837
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...
0
6036
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4667
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4260
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3268
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.