C Sharp :: Use A Program To Add New Class?
Nov 30, 2012Whether it is possible to add a new class to a program? For example: program a is my main program and I want to use program b to just add a new class to program a.
View 5 RepliesWhether it is possible to add a new class to a program? For example: program a is my main program and I want to use program b to just add a new class to program a.
View 5 RepliesIs there any way or trick to make a program that executes without using any class or class concept
View 4 Replies View RelatedWhat is mean by instantiating a class.
View 8 Replies View RelatedHow to use static in a class, function and variable.
View 1 Replies View RelatedI have base class with some properties(variables).I want to inherit that class and want to change name of that properties in the derived class using concept of Shadowing.
View 1 Replies View Relatedcan we give the restriction to method for a particular class
View 1 Replies View RelatedAs i have one Abstract base class say MyBase.
It have parameterized constructor with string value it have abstract method call.And I also have One child class say MyChild.
It does not have any constructor only one have public method and i want to call that parameterized constructor of base class onto child class.
I need to create a GlobalConfig class. But I want to derive from it in another class.
Here's an example:
public class BaseConfig {
public string GlobalPath {get; set;}
}
public class ConfigA : BaseConfig {
public string pathA {get; set;}
}
public class ConfigB : ConfigA {
public string pathB {get; set;}
}
The idea behind is that I don't want to write the code multiple times and what's more important in class ConfigA I want to set GlobalPath and have access to it in ConfigB.
In other word I want class ConfigB to have a property GlobalPath which was set in class ConfigA.
To clarify I want to have only one object of Config in memory.
When I set BaseConf.GlobalPath to 'A', I want to access it from ConfigB.GlobalPath and also get 'A'.
I always design GlobalConfig as a static class, but static classes can't be inherited. So I tried to implement Singleton Pattern, but ConfigA can't find constructor of class BaseConfig because it's private.
In my WPF application I created a LINQ to SQL entities class. Then I created a partial class and there add code to my entity class. Below is the code of it:
namespace Mynamespace {
partial class rts_index {
#region Fields
/// <summary>
/// Status:
/// "Selected" - true, "Unselected" - false.
/// </summary>
private bool _is_selected;
[code]....
Then I executed LINQ to SQL. Works perfectly well. Then I bound WPF Datagrid radiobutton column to is_selected property of the partial class. Below is XAML code:
.
.
.
<Window.Resources>
<CollectionViewSource x:Key="rts_indexViewSource" d:DesignSource="{d:DesignInstance my:rts_index, CreateList=True}" />
</Window.Resources>
[code]....
And here I have the problem. When I'm changing the radiobutton status from Unchecked to Checked it doesn't change the value of is_selected property from false to true in the partial class. I don't know why.
I developing a C++ Program to deal with huge data computation. I am using Pointers to hold the data during computation. Current program i developed without using CLASS.
I would like to ask that will the memory usage will be reduced and computational time will be shortened if I modified my program implementing the CLASS into it ?
Is it possible with C# to get the default program for an extension? I've already done some research for it, but the only thing I've found out is a way to make my program the default program for an extension. So I my question is, is it possible to use anything similar to check if there is already an default program for an specific extension and which program is it?
View 2 Replies View RelatedI have a program in C#.net. There is a datagridview which shows all the details of the student. Then I add a column to update another column using the value I entered. Means I want to add roll no to student details table while running. I want the code to update it. Is it possible?
View 1 Replies View RelatedI have a requirement where I have to import a lot of text files into excel. Up till now I can import the text files using visual studio C# but after importing the format is not exactly the way I want (mostly the delimiters). So I have to manually use the text import wizard and make the changes. I was just wondering if there is any way to program all of it. Delimiting the spaces, specifying the column widths, eliminating a few rows and columns.
View 1 Replies View RelatedFollowing is a script written in perl :
#Number of bugs edited in Watson Express
#find server*/watson*/log/ -name "watson*" -type f -newer ./tmpoldfile ! -newer ./tmpnewfile |
xargs grep "WX Edit Bug" | awk '{print $8}' | sort | uniq | wc -l
//
this is log parsing string in perl based on bash file.
Need a log parsing program in C# for the same.....
I have a Windows form application which has database and will store user details. my problem is while executing program form is not displaying .
View 1 Replies View RelatedI have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?
View 4 Replies View RelatedI have my program to load info about students from .txt file
Mrkvicka Jozef 2 1.75 2.1 0.4 1 0.49 1.27
Hrasko Jan 0.1 0.38 1 1.2
Mladek Peter 1.6 0.4 2 1.3 1.8
Petrzlen Robert 0.6 0 1.1 1.1 0.6 0.59
Horvath Ivan 1.6 0.8 0.7 1.3 1
My program is ruuning perfectly only problem is that i must transform it to program uses class, class student . Am very beginer in using classes, so far i do very easy programs using classes.
so far i have this
#include "stdafx.h"
#include "student.h"
student::student(vector<STUDENT> studenti) {
vStudent=studenti;
[Code] ....
I try to make it but its too difficult for me. in that student.h and student .cpp is 50 errors..
Here is my code
#include "stdafx.h"
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace std;
[Code] ....
I have a list of numbers in an array created by a class template
Code:
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
const int CAPACITY = 20;
template <class T>
class A
[code].....
Ive been writing this code all day and these errors have been killing.
Instructions:
Car Class:
Write a class named Car that has the following:
year. An int that holds the cars model year.
make. A string object that holds the make of car.
speed. An int that holds the cars current speed.
In addition, the class should have the following member functions.
Constructor. The constructor should accept the car's year and make as arguments and assign these values to a object's year and make member variables. The constructor should initialize the speed member variable to 0.
Accessors. Appropriate accessor functions should be created to allow values to be retrieved from an object's year, make, and speed member variables.
accelerate. the accelerate function should add 5 to the speed member variable each time it is called.
brake. The brake function should subtract 5 from the speed member variable each time it is called.
Demonstrate the class in a program that creates a Car object, and then calls accelerate function five times. After each call to the accelerate function, get the current speed of the car and display it. The, call the brake function five times. After each call to the brake function, get the current speed of the car and display it.
Errors: error C2061: syntax error : identifier 'stringm'
error C2533: 'Car::{ctor}' : constructors not allowed a return type
error C2511: 'Car::Car(int)' : overloaded member function not found in 'Car'
see declaration of 'Car'
fatal error C1903: unable to recover from previous error(s); stopping compilation
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
[Code].....
Write the definition of the class dayType that implements the day of the week in a program. The class dayType should store the day, such as Sunday for Sunday. The program should be able to perform the following operations on an object of type dayType:
a. Set the day
b. Print the day
c. Return the day
d. Return the next day
e. Return the previous day
f. Calculate and return the day by adding certain days to the current day. For example, if the current day is Monday and we add 4 days, the day to be returned is Friday. Similarly, if today is Tuesday and we add 13 days, the day to be returned is Monday.
g. Add the appropriate constructors
Write the definitions of the functions to implement the operations for the class dayType.
My code:
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string my_Day[7] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
class dayType
[Code] .....
And here are the error messages that I get:
Line 23 error: prototype for 'void dayType::setDay(int)' does not match any in class 'dayType'
Line 11 error: candidate is: void dayType::setDay()
Line 36 error: prototype for 'void dayType::getDay(int) const' does not match any in class 'dayType'
Line 13 error: candidate is: void dayType::getDay()
I know this is probably a really easy mistake but I am new to Programming and I have changed this code for days to no avail.
I am having difficulty with class objects.
1. why my program won't actually compare the two strings.
2. why and where I am having a memory dump crash.
The following is my main.cpp, String.cpp, and the header file in that order.
#include <iostream>
using namespace std;
#include "GREEN_String.h"
void main () {
GREEN_StringStr1;
GREEN_StringStr2 ("AdrianGreen");
[Code] .....
I am writing a program for a class where the user enters their age, how much money they have, and their full name. I know that I have to use the getline method to get the user's full name, and I know that I have to use cin.ignore() before that code, but i'm not sure why I have to use cin.ignore()?
View 1 Replies View Relatedgetting output from my code when I compile, the codeblocks ide doesnt show any errors it just doesn't give me any out put when I compile?
Here is my code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
//
//CLASS DECLARATION SECTION
[code].....
I am not exactly sure how to do this and i keep running into problems. This is my code here that works.
Code:
#include<iostream>
using namespace std;
struct record {
double quiz1;
double quiz2;
double midyear, midyear_one;
[Code] .....
I'm new to coding, and I have to write a program to display a class schedule to the user (the classes are entered into the program in strings like this:
Code:
course Calculus3 = {80934,"MATH",11,"Calculus 3","Edward Turner","M,W",950,1100}; )
in the format of an excel file (the user picks the classes they want to have) that then displays the course title and professor in the correct cell corresponding to the day/time the class meets. I've been googling it, and from what I've read, I think I need to use a csv file, but I don't know how to input the data into the file. I know the general format for how data is entered, but I don't know how to write it into a specific file or if I even have to (we covered txt files very briefly in my class, but never touched csv files).
I have the following problem on my C++ Program and I am not sure why it is not working. I am creating a infix to postfix program through an inherited class which I am not sure it is working.
#include <iostream>
#include <stack>
using namespace std;
int in_stack_Priority(char a){
if(a == '*' || a == '/')
return 2;
[Code] .....