Hi guys,

I have to write a program with a class that will take the number of the day in a year and display the month and day of that number. I'm stuck from the start. Can anyone give me a start that I can run with. I also need some help with the header. I know how to start writing a header but I don't know where to write it in visual basic or how to attach it to my .cpp file. Thanks for all you help.

Recommended Answers

All 6 Replies

What you're asking help with makes no sense. VB? What's that have to do with C++? And why do you need a header?

Forget everything but your first line -- "I have to write a program with a class that will take the number of the day in a year and display the month and day of that number." That's your problem, the rest seems meaningless.

What do you know? Arrays? Math? Number of days in a month?

I am in the chapter about classes. Just read it. We us vb in class its the only compiler that I know about that's why I mentioned it. While I was reading about making headers I think I understand the structure but don't know how to tie it into my program or here to enter the code. But the project asks us to prompt the user to enter a day of the year and display the month and day. For example you would enter 6 and the output would be January 6 or enter 360 and the output would be December 26.

VB is not a compiler, it is a language. Your using vc++ i assume. Even then, vc++ is not a compiler, its an IDE. Your compiler is most likely MingW.

I guess. That's just what we use in the class. I've never had any interest in programming before or ever tried. Was just introduced to these things in this semester. It's a lot harder to learn from an online class. I was doing great at first but now I'm getting into things I really don't follow as fast. Classes are really confusing to me. I need to write a class to convert day of the year to the month and day.

I am in the chapter about classes. Just read it. We us vb in class its the only compiler that I know about that's why I mentioned it.

well, you're in C++ now, so forget VB. It's completely different.

While I was reading about making headers I think I understand the structure but don't know how to tie it into my program or here to enter the code.

You don't need to make any headers, just use the ones already defined.

But the project asks us to prompt the user to enter a day of the year and display the month and day. For example you would enter 6 and the output would be January 6 or enter 360 and the output would be December 26.

I already got that. But you didn't bother to answer any of my questions.

vc++ is not a compiler, its an IDE. Your compiler is most likely MingW.

No, Visual Studio/VC++ Express has its own compiler. If you are using an IDE such as code::blocks or Dev-C++ that comes with mingw in some cases then that will likely be your compiler.

@OP I'm presuming you mean Visual Studio. This has the capability to do C#/C++/VB/ASP.NET etc. (a couple others in VS 2010). You are still more than likely using the C++

I need to write a class to convert day of the year to the month and day.

Ok so you're talking about the declaration of the class being in a header? It can be. Write out the declaration and see how far you get and we can look it over for you. Remember it's just the the types and access (public, private and protected) of the member variables and member methods(what you might call functions).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.