Reading a book about C#. (newbie question)

Status
Not open for further replies.
oops on that edit I mean to say 32 different values. Getting my words mixed up now! This is all new to me so it's a lot to take in.

I get pretty lost in this book. I need to take some basics first. Some stuff seems easy to understand then some stuff is over my head.
 
Which book are you talking about. You should send us a link so we dont buy this book if it's that bad.

I suggest hitting your public library and checking out a few different books on C# and see which one helps you learn the concepts the best. I like John Smiley books for the absolute beginner. I would stay away from the WROX books. Microsoft Press are good too.
 
Have you thought about a more indirect route? If I were you, then I would find out what Java book the local high schools use in their Advanced Placement/Honors Computer Science programs and use that book to learn the basics about variables, methods, classes, arrays, and other topics. Most of the Java principles elaborated in these books can be applied to other languages such as C#, C, and C++.

To provide an example, I have written some code below.
Code:
import java.util.Scanner;
public class Example
{
    public static void main(String[] args)
    {
     Scanner input = new Scanner(System.in);
     double i=0;
     double p=0;
     double result = 0;
     String response="yes";

     while (response.equalsIgnoreCase("yes"));
     {
     System.out.print("Please input the first variable: ");
     i = input.nextDouble();
     System.out.print("Please input the second variable: ");
     p = input.nextDouble();
     result = i + p;
     System.out.println("The result of your addition was "+result+". \n");
     System.out.println("Would you like to continue with adding numbers?");
     response = input.nextLine();
     }
}

See, the code above has variables, a loop, a String manipulation, and a print line. This would be the code a one week student in a Honors Computer Science program would learn. And, I hold the opinion anyone can learn this if he applied himself.

Now, I know your original post was about your C# book being too complex. I would just like to submit the idea that you take a less challenging language first. There is a reason why the College Board decided to switch from C++ to Java for the Computer Science courses.

However, it should be noted that this is the opinion of a kid that is in high school. I don't have any experience in the private sector or public for that matter. In fact, my only other work has been internships with geology and paleozoology.

Well, that's my two cents.
 
Thanks I have read some other beginner books. I have thought about a different language but I get different opinions about it. Some say stick with the language you want to learn. Why is C# more complex?

I was able to see the variables, loop and print line when i read your code. So I do understand some stuff. I think the basic stuff as a principal is easy to understand. Keep in mind I am new to this but I think my learning curve right now would be trying to actually right the code and knowing what to write and when.

I can look at code and get a general idea of what is going on. Writing it is a whole new sack of potatoes! :)
 
Thanks I have read some other beginner books. I have thought about a different language but I get different opinions about it. Some say stick with the language you want to learn. Why is C# more complex?

I was able to see the variables, loop and print line when i read your code. So I do understand some stuff. I think the basic stuff as a principal is easy to understand. Keep in mind I am new to this but I think my learning curve right now would be trying to actually right the code and knowing what to write and when.

I can look at code and get a general idea of what is going on. Writing it is a whole new sack of potatoes! :)

I think C# is more complex because it lacks a real open-source community or an inviting active community. I mean if you take a look at forums, then you will see that there is always an abundance of people who know Java. How many know C#? This could be just in my mind though. In addition, I think the tools that C# use are a bit more complex. Look up a Java compiler like BlueJ. Even Sun's Netbeans is easy to use. However, that is only my opinion.

Your statement that you can look at the code and understand, but you can't write it tells me that you don't do a lot of applications with your knowledge. So, if I may test this.

Can you write me a program that lets me enter my first, last name, and date of birth and have it printed out under headers that label them as such? You can be flexible with the DOB; it can be stored as an integer and concatenated into the print or entirely stored as a String. I don't care.

It should look like the following:

Enter your first name: Logarithms
Enter your last name: Techknow
Enter your DOB: 13/37/00

First Name Last Name DOB
======= ======= ===
Logarithms Techknow 13/37/00 (I know that's not a real date.)

I don't mean to challenge you, but I believe if you had an extremely rudimentary knowledge of C# you would be able to write a program that does this. You don't actually have to post anything. I am just presenting the question: "Can you do this?" I am interested in exactly how far you are in your learning.

(Quote formating screwed up the spaces in the code.)
 
C# and java are great languages for both beginners and more experienced programmers and I would say stick with whatever you have started. There is at least one open source implementation of the .net framework: Main Page - Mono. Also Logarithms, your code is isn't right.

What part of it?

edit: Oh, I put "result double = 0;"
 
Logarithms,

I've read this book about 10 months ago: Amazon.com: Absolute Beginner's Guide to Programming (3rd Edition): Greg Perry: Books

and now just started the one that I posted earlier.

So now I sure don't know where to even start. The book I read awhile ago I would need to read again. I just recall some stuff I read and noticed it in the code above.

So just to help me understand can you write it and let me see what it looks like? I like to learn where ever I can!

You guys have been great with help. Usually don't get much help with this stuff. I can't wait to start taking classes.

P:S I could probably drag and drop some things on a windows form app in VS 2008 that would let you fill out your name and DOB! LOL :)
 
I am sorry for any confusion, but I don't know C#. I was just expressing my opinion from what I knew about Java. My "test" was simply a way of knowing if you knew how to take input from the keyboard and properly format the information with escapes like "\t" or "\n."

However, I can write it in Java.
Code:
import java.util.Scanner;
public class Main
{
  public static void main (String[] args)
  {
   Scanner input = new Scanner(System.in);
   String firstName;
   String lastName;
   String month;
   int day;
   int year;

   System.out.println("Enter your first name: ");
   firstName = input.nextLine();
   System.out.println("Enter your last name: ");
   lastName = input.nextLine();
   System.out.println("Enter the month you were born: ");
   month = input.nextLine();
   System.out.println("Enter the day you were born: ");
   day = input.nextInt();
   System.out.println("Enter the year you were born: ");
   year = input.nextInt();

   System.out.println(First Name\tLast Name\tDOB);
   System.out.println(========\t========\t===);
   System.out.println(firstName+"\t"+lastName+"\t"+month" "+day+", "+year);
   }
}
 
Status
Not open for further replies.
Back
Top Bottom