Visual C++ :: Display A Monthly Calendar?

Dec 5, 2012

I need to write a function that displays the days of a specified month. I have been looking for sample code but haven't had much luck. Here are the guidelines for the function:

Write a void function named displayCalendarDays. This function is passed two input parameters. The first parameter is an int that represents the start day. Start days are numbered from 0 to 6 with 0 representing Sunday and 6 representing Saturday. The second parameter is an int that represents the number of days in the month. If the start day is not in the range 0 to 6 or if the number of days is not in the range 1 to 31, the program should display useful error message instead of displaying a calendar. If the parameters are OK, the program should display a calendar similar to the following:

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

After the last day of the calendar is displayed, the function should advance the cursor to the next line.

Note that for the display above, the start day is 3 and the numbers of days is 31.

View 1 Replies


ADVERTISEMENT

C# :: How To Display Monthly Attendance Report

Jun 9, 2014

I have a table in sql called empattendancetable the fields are

eid empname designation logindatetime status
emp001 abc manager 30-05-201412;00PM present

likewise i want to display the month wise attendance details of all the employees

the logindatetime field value from datetimepicker i am not getting how to write the query to get the month wise detailsusing c# i am creating a windows application to maintain the details of employees

View 11 Replies View Related

Visual C++ :: Calculate Total Of Monthly Costs Of Expenses And Show Annual Cost

Oct 5, 2012

The point of this is to calculate the total of the monthly costs of these 6 expenses and then to show the annual cost. However, there's just a couple of things that's giving me problems and it's the calcMonCost in my code. The error says that it is more than one instance of overload function and also that an unresolved external symbol. Everything else is fine. What does this mean?

Code:
#include <iostream>
#include <iomanip>
using namespace std;
void calcMonCost (double, double, double, double, double, double &);
void calcAnnCost (double, double, double, double, double, double &);
void getData(double &lnPymnt, double &insure, double &gas, double &oil, double &tires, double &maint);

[Code] .....

View 1 Replies View Related

C# :: User Monthly Expenses Integer Array?

Nov 19, 2014

Basically, I need to "write a program to simulate tracking monthly expenses" using an integer array into which the user can enter an expense. After that, it needs to loop back and ask them if they want to display their expenses or add another, which is the main thing I'm not sure how to make happen.

namespace Assignment2 {
class Program {
static void Main(string[] args) {
// display welcome message and ask if user wants to update or display monthly expenses
Console.WriteLine("Hello, this is a program to track your monthly expenses.");

[code]....

View 6 Replies View Related

C :: Calendar Doesn't Work

Sep 24, 2013

I just dont see what the issue is here. I have stared at this thing forever. Im trying to make a calendar from scratch so I can be prepared for my second test on Friday.

Code:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int i, n, s;

[Code]....

View 10 Replies View Related

C/C++ :: How To Format A Calendar Table

Apr 27, 2014

I am trying to format a Gregorian Calendar that accepts only the year as a user input, but I want the display to show 3 months on one row. I can get January to display correctly, but the February and March months do not.

I think my loop inside of my calendar1 function specifically is the issue:

//Is day before Sat? Else start next line Sun.
if ( ( day + daycode ) % 7 > 0 )
cout << right << setw(3);

[Code]......

View 1 Replies View Related

C/C++ :: Prime Numbers In Calendar?

Sep 25, 2014

The object is to have the user enter in the number of days then the day the calendar would start on. This part I was able to achieve and run okay. Once I wanted to get the values/days that were prime to have a P besides them this is where I ran into trouble. In this case P stands for prime numbers.

The issue I have is that some of the values that are prime have the correct P but others have the P as well such as 9, 15, and 25 - which are not prime numbers.

I was able to create a program that checked for prime numbers separately but I had issues merging them. Below is the merged code followed by the prime checker.

#include <stdio.h>
int main(int argc, const char * argv[]) {
int i, N, Start;
int j, GetNumber, PrimeNumber = 0;

[code].....

View 2 Replies View Related

C/C++ :: Calendar Dates Are Not Matching Up

Dec 7, 2014

In this project a user needs to enter a numeric month and a year. The output is a single calendar month with the name of the month followed by a grid of the days. My issue is that my day alignment is off. for example: if you enter the month of December (12) and this year 2014 it says the month started on a Wednesady when in fact it started on a Monday. I am not sure if its my leap year calculaion or what.

#include<iostream>
using namespace std;
#define TRUE 1
#define FALSE 0
char *months[] = {
" ",

[Code] ....

View 6 Replies View Related

C++ :: Program To Generate Calendar For A Year

Oct 15, 2013

Problem: Write a program to generate a calendar for a year. The program should accept the year and the day of the week for January 1 of that year (0 = Sunday, 1 = Monday, etc.). The calendar should be printed in the following form:

January
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
February
1 2 3 4 5

I have wrote code that has three functions, one to print the month, one to print the days in month, and one to find if it is a leap year or not. I have gotten up to the point where I can print the 12 months with a for loop, but how to print out the days in the format above.

This is my code.

#include <iostream>
using namespace std;
void printOneMonth(int month, int& dow, int year);
void daysInMonth(int month, int year, int& dim);
bool isLeapYear(int year);
int main(){
int year=0, dow, count;

[Code]...

View 1 Replies View Related

C++ :: Call Back For Calendar - WINAPI

Jul 10, 2014

I have made a calendar using a resource file and using the winapi

CALENDAR_DLG DIALOG 0, 0, 186, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Calendar"
FONT 8, "Ms Shell Dlg" {
CONTROL "", CALENDAR, "SysMonthCal32", WS_VISIBLE, 0, 0, 186, 95
}

My call back function is

BOOL CALLBACK DlgCalendar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch(uMsg) {
case WM_INITDIALOG: {
} return TRUE;

[Code] .....

DTN_DATETIMECHANGE is not being called ? What is UMSG equal to when a date is changed in the calendar?

View 5 Replies View Related

C++ :: Write A Program That Gives Current Calendar

Jan 14, 2014

I have a problem. I want to write a program that gives me the current calender for example like this:

June 2009

Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

and I shouldn't use windows.h

View 2 Replies View Related

C++ :: Class Calendar - Pointer To A Function Error

Nov 30, 2013

I have a class Calendar which has an attribute of priority queue, that accepts records of structure defined as:

typedef void (Calendar::*eventPointer)();
struct activationRecord {
double Time;
int Priority;
eventPointer activationEvent;
};

And here is the problem. Whole day I've been trying to fill the Calendar with some test entries by calling the method

void Calendar::calendarPush(double Time, int Priority, eventPointer event)

This is how I call it

calendar.calendarPush(Time, Priority, &Calendar::calendarEmpty);

But Visual Studio keeps to warn me with this error

argument of type "bool (Calendar::*)()" is incompatible with parameter of type "eventPointer *"

#include <iostream>
#include "Calendar.h"
using namespace std;
int main() {
cout << "Initializing ..." << endl;
double Time = 0.0;
int Priority = 0;

[Code] ....

View 4 Replies View Related

C++ :: Generate Calendar For A Year - Day Of Week Month Starts From

Oct 18, 2013

So for my C++ class I am required to create a program that will "Write a program to generate a calendar for a year. The program should accept the year and the day of the week for january 1 of that year (0=Sunday, 1=Monday, etc.)" (problem statement) and I am completely stuck. I've posted what I have so far below:

#include <iostream>
#include <iomanip>
using namespace std;

bool isLeapYear(int year);
int daysInMonth(int month, bool lpYear);
int printCalendar(int month);
int printDay(int dow);

[Code] .....

View 3 Replies View Related

C++ :: Develop Month Calendar By Designing A Class - Inheritance And Composition

Nov 10, 2014

In this assignment the student should develop a month calendar by designing a class called calendarType . This class uses two other classes (dateType and dayType) as described below:

1. dayType Class: This class has been designed by students in Lab1 exercises. Referee to it.
2. dateType Class: This class is designed and implemented to keep track of data. This class has been provided it to you. Study it first then add definitions and implementations of the following operations to this class:

- Test whether the year is a leap year. Leap year is identified by 3 criteria :
- The year is evenly divisible by 4;
- If the year can be evenly divided by 100, it is NOT a leap year, unless;
- The year is also evenly divisible by 400. Then it is a leap year.
- Return the number of days in the month. For example, if the date is 12/3/2014, the number of days to be returned is 31 because there are 31 days in March.
- Return the number of days passed in the year. For example, if the date is 18/3/2014 the number of days passed is 77. Note that the number of days returned also includes the current day.
- Return the number of days remaining in the year. For example, if the date is
18/3/2014 , the number of days remaining in the year is 288.
- Calculate the new date by adding a fixed number of days to the date. For example, if the date is 18/3/2014 and the days to be added are 25, the new date is 12/4/2014.

To print monthly calendar using calendarType class, you must know the first day of the month and the number of the days in that month. Thus, you must store the first day of the month, which is in the form of dayType and the month and the year of the calendar. Clearly, the month and the year can be stored as an object of the form dateType by setting the day component of the date to 1, and the month and year as specified by user.

Design the class calendarType so that the program print a calendar for any month starting 1/1/ 1500 which is Monday. To calculate the first day of a month, you can add the 2 appropriate days to Monday of January 1, 1500. For this class identify and implement the following operations:

- Determine the first day of the month for which the calendar will be printed. Call this operation firstDayOfMonth.
- set/get month.
- set/get year.
- Print calendar for particular month.
- Add the appropriate constructors to initialize the member variables.
- Write a test program to print the calendar for either a particular year or a particular month.

View 1 Replies View Related

C++ :: Date Class - List Major Holidays And Print Calendar For Given Year

Mar 20, 2013

I'm trying to implement a Date class to create a simple application for " Major U.S. holidays calendar System ", that provides a list of major holidays for a given year AND prints the calendar for the given year either online or write to a file. I need to finish up the class date.h, which is

#ifndef DATE_H
#define DATE_H
#include <string>
#include <iostream>
using namespace std;
string Month[]={"" , "January", "Febraury", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"};

[Code] .....

View 1 Replies View Related

Visual C++ :: Display Hex In Edit Box?

Sep 24, 2013

I'm trying to take a value from an edit box and display it in the edit box as hex. I'm using this code:

CString buffer;
int intbuf;
m_edit[5]->GetWindowTextA(buffer);
intbuf = atoi(buffer);
buffer.Format("%02X", intbuf);
m_edit[5]->SetWindowTextA(buffer);

If I include the last line of code here I get a stack overflow error. If I don't include it, I can run through the debugger and the buffer CString is converted to hex just like I want, I just can't display it because I get that error.

View 4 Replies View Related

Visual C++ :: Project To Display Raw Image

Nov 25, 2012

Used some online code example to put a little project to display raw image. The display does not seem to work.For some purposes, I like this to work with a dialog based MFC project.XDVView is derived from CScrollView.

See OnInitDialog() and OnDraw(CDC* pDC).8bit 768x756

View 14 Replies View Related

Visual C++ :: CFileDialog Does Not Display File Name Correctly

Sep 13, 2013

I haven't seen this before but on Windows 7 Home Professional and VC 2012 in one particular app, a CFileDialog displays only the rightmost 11 characters plus the extension of the default file name. The rest of the name is there and you can scroll left in the file name edit to display it all, but initially the text is shifted left so it doesn't all display.

Code:
CFileDialog dlg(TRUE, "csv", strFileName, OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY, "Comma Seperated Values Files (*.csv)|*.csv|All Files (*.*)|*.*||");

strFileName can contain anything and it will do it. Even a string literal will do it.

View 3 Replies View Related

Visual C++ :: Button To Display Text Box Message?

Jul 13, 2014

I'm currently making a math program in c++ windows form application. I'm trying to make it so where the user presses the number button I such as 1 button to display a 1 in my textbox.

Code:

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
}

View 1 Replies View Related

Visual C++ :: Unable To Display Dialog In UI Thread

Mar 11, 2015

I am having a strange problem trying to display a dialog from a UI thread. The dialog simply fails to display. I have a function DisplayFlashBox(), which creates the UI thread:

CUIThread* CIMUIHelper:: DisplayFlashBox(const CString &sMessage, const int nInstrumentUID) {
CUIThread *pThread = new CUIThread();
pThread->SetString(sMessage);
pThread->SetInstrumentUID(nInstrumentUID);
pThread->CreateThread();

[Code] .....

The dialog doesn't display. When I tried debugging, I found the OnInitDialog() method of CIMFlashBox class doesn't actually return. Very strange. I tried calling the DoModal() method instead of Create, but doesn't display the dialog either.

View 5 Replies View Related

Visual C++ :: Adding Manifest In MFC For UI Controls Display?

Dec 5, 2012

I have migrated my MFC application from Visual Studio 6 to VS2010. But the UI controls still looks the same as of old theme. How can i add the manifest file now to get the UI controls to be displayed as of the current OS theme. i.e. Win7 look if the application is run on windows 7.

View 1 Replies View Related

Visual C++ :: Display CDialog App Inside A Web Browser Like IE

Dec 16, 2013

I am making a dialog app using CDHtmlDialog and all the controls are done using HTML.

Now i want to call/display this dialog inside a web browser like IE.

How can i do that?

If i could generelaize this question -

Is it possible to display a dialog app that is derived from CDialog inside IE?

If possible, how to do that?

View 7 Replies View Related

Visual C++ :: Display Arrays Using Call Statements

Oct 21, 2014

I am trying to display the following arrays.

int a[4]={5,9,2,10}
int b[3][3]={1,2,3,4,5,6,7,8,9}
int c[2][3][2]={1,2,3,4,5,6,7,8,9,10,11,12}

Using these call statements

Display (a,4);
Display(b,3);
Display(c,2);

I'm not sure on how to put this all together but this is what I have so far.

Code:
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
} int a[4] = {5,9,2,10};
Display(a, 4);

[Code] .....

View 4 Replies View Related

Visual C++ :: Display Values Of 2-dimensional Array

Aug 31, 2013

1.Create one 2-dimensional array. The array will consist of numbers from 1 to 10. And will also contain the number in words. Display the values of the 2-dimensional array.

Sample output:
1 - One
2 - Two
3 - Three

Paste the program code here:

2.Create a program that will accept two integer numbers. These integer numbers will be the limit of the multiplication table. Store the values in a two dimensional array.

Sample output:
Enter x: 3
Enter y: 2
123
246

Paste the program code here:

3. Determine the output produced by the following program segment.

int ROWS = 3;
int COLS = 4;
int [ ] [ ] val = {{8,16,9, 52},{3,15,27,6},{14,25,2,10}};
for (int i=0; i < ROWS; i++) {
for (int j= 0; j<COLS; j++)
System.out.print (val [i][j] + " " );
System.out.println ();
}

Write the Output:

View 6 Replies View Related

Visual C++ :: Enter First And Surname And Then Display Full Name

Sep 21, 2012

I'am new to C++, program is : enter first and surname and then display the full name:

code below:

// Enter first and surname and then display the full name.
#include<iostream>
#include<string>
#include<cctype>
using namespace std;

[Code] ....

View 10 Replies View Related

C++ :: Simple LED Type Display Visual Studio 2008

Jul 3, 2013

looking for a simple LED type control for Visual Studio 2008. I just need a control that I can add to the toolbox where I can pass a parameter to define the colour. This is an MFC based application. how to add a new control to the toolbox. I have been programming in 'C' for many years but find some of the IDE's confusing as to how to do things (as above)

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved