C++ :: Program On Periodic Table

Apr 13, 2014

program in which i have to write a code in c++ to print a periodic table and when any of its element is clicked, it will show the basic details of that particular element. also, use of graphics is required.

View 2 Replies


ADVERTISEMENT

C++ :: Periodic Table Program - Array Of Objects

Feb 4, 2014

I'm writing a periodic table program to understand classes. I want to be able to display/sort the elements by several properties such as whether it's a metal, nonmetal, or metalloid. I'm not sure hwo to do it, but my first guess was to create an array of objects; however, I'm having problems using my constructor to set the values.

Class
class Element{
public:
enum class groupNames { HYDROGEN, ALKALI, ALKALINE, GROUP_THREE, GROUP_FOUR, GROUP_FIVE,
GROUP_SIX, GROUP_SEVEN, GROUP_EIGHT, GROUP_NINE, GROUP_TEN,
GROUP_ELEVEN,GROUP_TWELVE, GROUP_THIRTEEN, GROUP_FOURTEEN,
GROUP_FIFTEEN, CHALCOGEN, HALOGEN, NOBLE_GAS,

[code].....

View 5 Replies View Related

C++ :: Periodic Table - Char Element?

Mar 11, 2013

Here is the code

#include <iostream>
using namespace std;
int main () {
char element;
cout << " Please enter a symbol. " << endl;

[Code] ....

let's say someone puts in h and Hydrogen comes up, and when someone puts in he, hydrogen also comes up, what am i doing wrong.

View 3 Replies View Related

C++ :: Hash Table Program - Sorting Pointer Table After All Of Values Entered

Nov 19, 2013

I am having an issue with my sort function. This is one part of the Hash table program. The main issue is that I am trying to sort the pointer table after all of the values have been entered. The ptr_sort function is not a class function and so I am therefore unable to use the class variables psize and pTable. Is there another way I should be trying this? it is a Vector should I use the sort() function from the vector class in STL?

#include "/home/onyuksel/courses/340/progs/13f/p9/util9.h"
#include "/home/onyuksel/courses/340/progs/13f/p9/hTable.h"

#ifndef H_TABLE1
#define H_TABLE1
void ptr_sort ( );

[Code] ....

View 1 Replies View Related

C++ :: Program To Generate Symbol Table?

Mar 10, 2014

Need to create a program in c++ to generate a symbol table of given assembly language program?

View 1 Replies View Related

C++ :: Truth Table Generator - If User Enters String Of Boolean Algebra It Will Output Table

Jan 25, 2013

If a user enters a string of boolean algebra it will ouput the table.

I have input parsing, cycling through the combinations, and outputing working. However once i parse the input I am not sure what to do with it. I have thought of having it write the parsed input to a new file as a function and then use that function, but that seems bad.

How to dynamically create the function, how to implement it.

BTW This is a console function, if that changes anything.

View 2 Replies View Related

C# :: Lookup Non-existent Rows In MySQL Table And Then Update Another Table

Dec 15, 2014

I have written an SQL statement that would:

1) Count the number of rows in the table booking that are open and where the booking.postcode is "MK",

2) Take a note of the plot (in booking.plot_id), and then update the table plot.jobs with the value count.

For example running the SQL query when booking table has the following rows:

Would see the following highlighted values in plot.jobs being updated to 1:

I managed to resolve it with this code so far (note I am using Connector/Net):

public void RefreshPlot(){
string query =
"SELECT Count(*) AS count, plot_id FROM booking WHERE postcode='MK' AND status='open' GROUP BY plot_id";
var cmd = new MySqlCommand(query, _connection);
var da = new MySqlDataAdapter(cmd);
var dtCounts = new DataTable();
da.Fill(dtCounts);

[code]....

Currently, my code only checks for existing rows in the booking table and updates the plot table. However if the row gets deleted in the booking, then the changes are not reflected in the plot table.

Example: If we delete the row with plot.id=1 and plot.plot_id=4, then booking.plot_id should go back to being 0, if it was initially 1. At the moment, it doesn't. How would I update my SQL statement to better reflect this? In a sense, it should check for "non-existent" rows, i.e. the impact that the row plot.plot_id=4 & plot.id=1 has on booking.plot_id when deleted?

View 6 Replies View Related

C :: Program To Calculate Loan Balance Table

Sep 22, 2013

so i am just hitting writers block on this one... its lengthy and i am very little into it...

The program takes 4 entered values (total loan, apr, monthly payment, and length of loan).

It is to put out a table that gives the new loan balance each month and the total interest payed at the bottom.

View 2 Replies View Related

C# :: Writing A Program To Display Multiplication Table?

Feb 3, 2015

i need the output to display the product of every whole number from 1-3 in a table format.

this is the code i have so far. i know some brackets are missing but i just pasted the meat of the code. when i run the program i keep getting the number 1 displayed in a straight line going on forever

int multiply1 = 1;
int multiply2 = 1;
while(num1<=3)
{ // num1*num2;
//num1 = 0;
while(num2<=3)
{ Console.WriteLine(multiply1*multiply2);
if(num1>=3)
{ Console.Write();
}
}
num1++;
}

View 2 Replies View Related

C Sharp :: Copy Data Table To MySQL Table

Mar 25, 2013

I have a C# .NET Application which get data from QuickBooks via the ODBC Driver and save the result to C# data table. So, I want to transfer this data table to a mysql table on my own server. That's the code I use:
 
using System.IO;
using MySql.Data.MySqlClient;
//Add mysql dll on the .NET Tab in Project's references  
string connStr = "DSN=QBTest;";  
            string myServerAddress = "192.168.0.243";
            string myDataBase = "CostTest";

[Code] ....

View 2 Replies View Related

C :: Program That Prints Multiplication Table Using Nested Loops

Mar 9, 2013

Write a program that prints a multiplication table using nested loops. In main ask the user for the smallest column number , the largest column number and the size of the increment. Ask the user for the same information for the row values.

In the example the column values entered are: 5, 15 and 2 and the row values 3, 6 and 1.

Given those numbers you would generate the following table.

Multiplication Table
| 5 7 9 11 13 15 ___|___________________________________ | 3 |
15 21 27 33 39 45 4 | 20 28 36 44 52 60 5 | 25 35 45 55 65 75 6 | 30 42 54 66 78 90
Print the 24 values with the grey background. The other numbers show the values to be multiplied.

Code:
#include<stdio.h>
main() {
int a,b,c,d,e,f;
int i,j,total;
printf("Please enter smallest column number: ");
scanf("%i",&a);
printf("

[Code] ....

Challenge:
As an added challenge try to print out the column
headings (5 7 9 11 13 15) and the row headings (3 4 5 6)

View 1 Replies View Related

C++ :: Program To Make A Table For Any Input Number - Do While Loop

Nov 27, 2014

Write a program to make a table for any input number and then continuesly ask to press y to print more table and if you press any key other than y then program must be terminate using while loop and do while loop. How to start or end with it.

View 2 Replies View Related

C++ :: Program That Create And Display Table Of Temperature Conversions

Feb 12, 2015

Write a program that creates and displays a table of temperature conversions. Get the starting temperature from the keyboard in degrees Celsius (do not allow input of a value below absolute zero). Also get an integer value to represent the number of degrees to increment for each of a 20 row table (do not allow the increment value to be less than one. The first column will be a row number starting with one, follow by the Celsius value and then the conversions into Fahrenheit, Kelvin, and Rankine. Be sure that all columns are neatly right aligned for a variety of inputs.

Thats what i wrote so far:

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double C,F,K,R,n,a;
cout <<"Enter starting temperature in Celsius: ";
cin >> C;
[Code] ....

Thats what the instructor looking for:

Enter starting temperature in Celsius: -500
ERROR: Temp must be >= -273.15: -273.15
Enter increments in degrees Celsius: 100

# Cels Fahr Kelv Rank
1 -273.15 -459.67 0.00 0.00
2 -173.15 -279.67 100.00 180.00
3 -73.15 -99.67 200.00 360.00
4 26.85 80.33 300.00 540.00
5 126.85 260.33 400.00 720.00
6 226.85 440.33 500.00 900.00
7 326.85 620.33 600.00 1080.00
8 426.85 800.33 700.00 1260.00
9 526.85 980.33 800.00 1440.00
10 626.85 1160.33 900.00 1620.00
11 726.85 1340.33 1000.00 1800.00
12 826.85 1520.33 1100.00 1980.00
13 926.85 1700.33 1200.00 2160.00
14 1026.85 1880.33 1300.00 2340.00
15 1126.85 2060.33 1400.00 2520.00
16 1226.85 2240.33 1500.00 2700.00
17 1326.85 2420.33 1600.00 2880.00
18 1426.85 2600.33 1700.00 3060.00
19 1526.85 2780.33 1800.00 3240.00
20 1626.85 2960.33 1900.00 3420.00
Press any key to continue . . .

My question is to know how to make the sequence from 1 to 20 and whats the best statement for increment...

View 2 Replies View Related

C :: Bulls And Cows Program - Compare Table With Input String

Dec 14, 2013

I'm having a small problem on comparing a table i coded with a string that I want to input. I'm actually building a Bulls and Cows program and this is part of my assignment. What i want to do is to input a string and from the table get the results compared to the string i inputted.

Few words about the Bulls and Cows program.

The game involves two players, a coder and a cracker. The coder (either a person or a computer) chooses the four-digit number with all different digits and keeps it secret. The cracker tries to guess the secret number. After a guess, the coder gives you information about number of digits which were correctly guessed but in the wrong place (they are called 'cows') and how many are both the right digit and in the correct place (they are called 'bulls').

For example, if the coder chooses the secret number 0419 and the cracker guesses 6039, then the coder scores this as 1 cow, since 0 is a digit in the secret number that's in the wrong place, and 1 bull (9 is in the right place.)

what i want to do is when i input a string it scans the whole table of possibilities and gives me the results based on the string. so each row of my table is (let's say the secret code) and based on the given string(the guess) it gives me the result. Here's my table code:

Code:
void initialize(int poss[1296][4])
{
int i=0;
int j, k=0;
int m;

[Code] .....

View 2 Replies View Related

C# :: Use Table Adapter With Textboxes To Edit SQL Table?

Mar 8, 2015

I am a bit stumped with trying to write some code to get the tableadapter/binding source to "update" a current 'user' to the table.

I have the insert/delete methods working fine, but it's the updating that has got me screwed up.

Example of insert.

try
{
personTableAdapter.Insert(tFirstName.Text, tSurname.Text, Convert.ToDateTime(tDoB.Text), tPhone.Text, tAdd1.Text, tAdd2.Text, tSuburb.Text, tState.Text, tPostcode.Text, TeacherType.Text);
teacherTableAdapter.Insert(Convert.ToInt32(tTID1.Text), tRegNo.Text, tPassword.Text);

[Code]....

I also tried to do the updated string/original string with the tableadapter.update, but that didn't work either.

View 7 Replies View Related

C :: Program To Create Output File Containing Customized Loan Amortization Table

Nov 18, 2013

Write a program to create an output file containing a customized loan amortization table. Your program will prompt the user to enter the amount borrowed (the principal), the annual interest rate, and the number of payments (n). The payment must be rounded to the nearest cent. After the payment has been rounded to the nearest cent, the program will write to the output file n lines showing how the debt is paid off.

Code:

#include <stdio.h>
#include <math.h>
int main (void) {

[Code].....

View 1 Replies View Related

C :: How To Add New Value To Hash Table

Apr 18, 2013

I have a problem with this function that adds a new value to the hash table or updates its data if the value already exists:

Code:

int tab_add(tab_disp *td, const object *value) the function should return:
TABDISP_OK if the value is correctly added, or TABDISP_ERROR if memory error, or TABDISP_INVALID if pointer td = NULL

The type of structure I am using is the following:

Code:

typedef struct {
char key[25];
char value[100];
} object;

[code]....

View 2 Replies View Related

C++ :: Get DateTime From A Table

Aug 5, 2013

I'd like to get a a field name "eventDateTime" from a DB table and its storage is datetime year to fraction (3) . I have created a function return results like this but i put its type as a int:

int Status::GetEventFromSQL(){
int j = 0;
int eventTime = 0;
MYSQL_ROW myROW;
MYSQL_RES *myRES = NULL;

[code]....

"eventTime " is also declared in another sheet .h as an int. In execution i have a big and negative number ; I know that's because of the int type but i'm bigenner in C++...

View 2 Replies View Related

C++ :: How To Output A Table

Oct 1, 2014

How would I output a table in C++? I did it a while ago, but I do not remember how, nor do I have the source for the program I did it in.

View 2 Replies View Related

C++ :: Table Of Numbers From 50 To 150

Apr 3, 2013

in this we have to show table of 50 to 150 like 50 table from 1 to 10 then 51 table ......150 table i just want to know is there any way i can get this using loop not using nested loop i made the nested loop code to show you what i want on ouput

#include<iostream.h>
#include<conio.h>
void main()
{

[Code]....

View 11 Replies View Related

C# :: How To Add A Child Row To A Table

Aug 1, 2014

I have a table in which data is populated via an element. However some elements can have a parent element

The client now wants all the children and parent elements to be next to each other row wise.

How can i add the child rows under the parent rows?

parents
foreach (var inspection in elemInspections) {
var date = db.INSPEVNT.Find(db.INSPEVNT.INSPKEY == inspection.INSPKEY && db.INSPEVNT.BRKEY == m_sBrKey);
var paircode = db.PON_ELEM_DEFS.Find(db.PON_ELEM_DEFS.ELEM_KEY == inspection.ELEM_KEY);

[Code] .....

how can i make it so the children go under the parent rows?

View 2 Replies View Related

C :: Multiplication Table In 2D Array

Dec 30, 2014

I want to declare a 2D 4*4 array, and fills the array with the multiplication table of an integer x from the user, for example: x*1,x*2,x*3, ....., x*16 and how to pass that array to a function to print the array and to another function that swaps a column with another column chosen by the user.

View 3 Replies View Related

C :: How To Generate Hash Table

Jul 29, 2013

Code: I have these two columns.

ID Group
0 2
1 2
2 3
3 4
4 4
5 4
6 4
7 4 Code: I want to store ID values on the bases of same Group, like we do in Hash table (key, value) .

Group ID
2 0,1
3 2
4 3,4,5,6,7

so when i said key 2 it will give me 0,1. how can i do it. As first i thought that i can use array of array but then how i can store the value of key. Now I am thinking of hash but i don't know how I will store and retrieve these values.

View 5 Replies View Related

C++ :: Making A Table For 10 Employees

Apr 22, 2014

I have to make a table for 10 Employees to look like this:

Employee ID Gross Pay Net Pay
101 540.58 480.80
158 796.32 630.20

How can I do this? This is my code so far.

#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void get_emp_rec(int &id, double &prate, double &hours) {

[Code] ....

View 2 Replies View Related

C++ :: Multiplication Table Using Functions?

May 25, 2013

how to print a multiplication table of 2,3 ,4 or any table using functions in c++.. ?

Remember using "Functions" e.g Multiplication(int x)
{ }
int main{
then call the function}

View 3 Replies View Related

C++ :: Decode A Table To An Array

Aug 13, 2014

I have recently run into a problem at work in regards to organizing information for some variables in a table and sorting them based on priority values...

For example:

Case ID: 0 1 2 3 4
1 (2 3) (1 2) (5 1) **the first number in the () is the priority*
2 **the second number is the variable id**
3

So from up above (I made it shorter than mine), I have a table with 8 columns for the different cases and 30 rows for the different conditions possible. I am trying to figure out a way to create some type of function that will be able to run through the row and pick the case with the highest priority first (from 1-8), and output the case ID, the priority, and the second number within the brackets.

I thought about creating a decoder that will sort the values and give an array with the outputs, but I know there must be a smarter way to sort the data.

View 1 Replies View Related







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