C# :: Emails And Phone Numbers - Output List Name Not Text?

Sep 11, 2014

Trying to output a .txt file of names emails and phone numbers, but this only outputs the list name: Email.PersonEntry.

private void button1_Click(object sender, EventArgs e) {
DialogResult result;
string fileName;
//Find and Open File

[Code] ....

View 6 Replies


ADVERTISEMENT

C :: Write A Main Function That Parses A Text Document And Prints Out All Of Phone Numbers Found

Apr 21, 2014

You should implement the following function:

int is_phone_number(char* string)
This function will take in a string and return 1 if it looks like a phone number 0 otherwise. A phone number takes the form (xxx)-xxx-xxxx where the xs are digits 0-9. So for example (123)-456-7890 is a valid phone number while 123 456-7890 is not.

You should also write a main function that parses a text document and prints out all of the phone numbers found. Hint, look up the strtok function.

Sample input:
Please call me at (123)-456-789 sometime tonight.

Sample output:
Phone number : (123)-456-7890

View 5 Replies View Related

C++ :: Output Numbers From A Set Of List Not Used

Mar 25, 2014

This is one part of my program, I need a loop that checks through the input(specifically the agent numbers) and then outputs the agent numbers that aren't in the input, from 1 to 20(because there should only be 20 agent).

My input is :
1 3 250.00
2 0 0
15 1 1000.00
3 4 300.00
12 2 500.00
1 2 300.00
3 4 115.00
21 3 400.00
-1 4 250.00
15 1 200.00
9 5 -150.00
18 2 140.00
13 2 550.00

the first numbers are the agent numbers so 1 , 2 ,15 are agent numbers and out output for agents who didnt participate are : 2 , 5 , 6 , 7, 8, 9, 10 , 11 , 14 , 16 , 17 ,19 20

this is the code ive wrote but its not working.

void not_part() {
ins.open(in_file);
int i=0;
int sum=0;
cout<<"AGENTS WHO DID NOT PARTICIPATE IN THE CAMPAIGN"<<endl;
cout<<fixed<<showpoint;

[code].....

View 1 Replies View Related

C/C++ :: Output Numbers From Set Of List That Were Not Used

Mar 24, 2014

This is one part of my program, I need a loop that checks through the input(specifically the agent numbers) and then outputs the agent numbers that aren't in the input, from 1 to 20(because there should only be 20 agent).

My input is :
1 3 250.00
2 0 0
15 1 1000.00
3 4 300.00
12 2 500.00
1 2 300.00
3 4 115.00
21 3 400.00
-1 4 250.00
15 1 200.00
9 5 -150.00
18 2 140.00
13 2 550.00

the first numbers are the agent numbers so 1 , 2 ,15 are agent numbers and out output for agents who didnt participate are : 2 , 5 , 6 , 7, 8, 9, 10 , 11 , 14 , 16 , 17 ,19 20

This is the code:

void not_part() {
ins.open(in_file);
int i=0;
int sum=0;
cout<<"AGENTS WHO DID NOT PARTICIPATE IN THE CAMPAIGN"<<endl;
cout<<fixed<<showpoint;

[Code] ......

View 11 Replies View Related

C/C++ :: Better Way To Parse And Format Phone Numbers?

Sep 3, 2014

I'm a student. I've complete an exercise where the goal is to parse some user input to output phone numbers using EXACTLY this style (not including the quotes): "1-888-8888".

Some rules that I've set for my parser are,

1) the phone number can be mixed in with other text, e.g. "My number is 38888888" or "1asdfk8888888" and

2) the first number found must be a valid calling code (1-9).

I wanted the parser to be flexible. Is this nesting too deep?

std::string format_phone_num(std::string &s) {
std::string formatted_num = "";
bool call_code_found = false;
short num_count = 0;
for (unsigned int i = 0; i < s.length(); i++)

[code].....

View 4 Replies View Related

C :: How To Make Array Of Structures For Basic Contact List In A Phone

Oct 17, 2013

So for class I have to make an array of structures for a basic contact list in a phone.

I understand the bones of the program and how to go about doing most of it but as far as arrays of structures go I am blind.
Code:

struct phone
{
char FirstName[16];
char LastName[16];
int Number[11];
};
struct phone numbers[friends]; //friends is a variable assigned by the user What I am a bit confused about is say the user enters 30 as how many friends they have. How would I assign a value to the 3rd struct for LastName?

View 3 Replies View Related

C++ :: File Input / Output - Getting Highest And Lowest Number From A List Of 7 Numbers

Apr 16, 2013

I am currently confused on how to get the highest and lowest number from a list of 7 numbers for a File Output. Lets say i have 165 19 654 816 654 987 324. How would i get the 987 for the highest and the 19 as the lowest? Those numbers are not fixed numbers, i need to be able to input any combination of numbers and still be able to get the highest and lowest numbers from the list of 7 numbers.

View 1 Replies View Related

C# :: Prevent Sending Multiple Emails

Dec 10, 2014

I have some code which triggers an alarm when an ascii number is read in on the com port:

In that code, i have it send an email to let me know i have an alarm. The problem is it keeps sending the email over and over until i cancel the alarm. Inbox gets full real quick!

Im having trouble implementing a way to send the email just once! Ive googled as much as i can find but i cant get any way to work.

//QT TANK TEMP TOO LOW:
if (ALARM_TYPE_Value == "5") {
ALARM_TYPE_tb.BackColor = Color.Red;
ALARM_TYPE_tb.Text = " **ALARM**" + Environment.NewLine + " ";
ALARM_TYPE_tb.Text += "

[Code] ....

View 4 Replies View Related

C/C++ :: How To Perform Data Validation For Emails

May 15, 2013

I have this big project and I need to do data validation for an email.

View 1 Replies View Related

C++ :: Looping - Input Numbers Until User Types 0 Then Output Product Of Non Zero Numbers

May 1, 2014

How to do the problem below using loop?

Input numbers until the user types a 0, then output the product of the non 0 numbers: e

E.g., if the user types 2 4 6 0, the program should output 48

View 3 Replies View Related

C Sharp :: Display Of Unread Emails In Outlook Through C#

Jul 8, 2014

Im looking for the process in C# where I give email id and password of any outlook user and to display all unread emails from outlook.

Example :

Email id : xyz@abc.com
Password : cnauhicu

When I give this email id I need all unread email from that account xyz@abc.com

Email id : rts@abc.com
Password : ncauhscua

When I give this email id I need all unread email from that account rts@abc.com

View 2 Replies View Related

C :: Using Fwrite With Text Output

Mar 9, 2013

I have the following code:

Code:
void Plot(int nx, int ny, double x[350], double y[350], double C_new[350][350], int iplot){
int i, j;
char fname[50];
FILE *fp;

[Code]....

I am then taking the generated file and importing it into a plotting program (Techplot360). It would speed up the importing process if I created a binary file instead of a like above. I know that I need to use fwrite but I am unsure how to handle lines like

Code:
fprintf(fp, "TITLE= ABCDEFG_%d
", iplot); and

Code: fprintf(fp, "%f %f %f
", x[i], y[j], T_new[i][j]);

View 6 Replies View Related

C++ :: Output 2 Different Text Files

May 22, 2013

So I'm trying to output 2 different text files, one has customer names and the other has items they are selling. I gave each customer an ID and each of their items has the same ID. Only problem is when I try to output it, it only outputs the first item with the same ID. I do not want to display the ID number at all, I think getline would show it so I am not using it.

here's my code

ifstream infile, infile2;
string Fname, Lname, email, item, itemPrice;
int id, itemID;
infile.open("Data.txt");
infile2.open("ItemList.txt");

[Code] .....

The first customer shirt item isn't being outputted. Maybe I'm reading the or comparing the info wrong or just not seeing it.

View 2 Replies View Related

C++ :: Linked List Output Incorrect?

Oct 30, 2013

Were are to implement a method countValue() that counts the number of times an item occurs in a linked list. Remember to use the STL <list>

int countValue(list<int> front ,const int item);

Generate 20 random numbers in the range of 0 to 4, and insert each number in the linked list. Output the list by using a method which you would call writeLinkedList which you would add to the ListP.cpp.

In a loop, call the method countValue() , and display the number of occurrences of each value from 0 to 4 in the list.

Remember that all the above is to be included in the file ListP.ccp

The output should be:
2 3 4 0 1 0 2 4 2 3 3 4 3 3 3 0 0 2 0 2

0 : 5, 1 : 1, 2 : 5, 3 : 6, 4 : 3

but I am getting:

1 2 4 0 4 4 3 3 2 4 0 0 1 2 1 1 0 2 2 1

0 : 4, 1 : 5, 2 : 5, 3 : 2, 4 : 4,

Here is my code:

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

[Code].....

View 1 Replies View Related

C :: Output Does Not Print On Text File

Jul 19, 2013

In this program I can not print the typed value in the file. The file creation well done but it is an empty file

I press Ctrl +z for EOF

Code:
#include<stdio.h>
int main(void){
FILE *fp;
char ch;
fp=fopen(" Test.txt","w");
printf(" Enter the TEXT

[Code] .....

View 1 Replies View Related

C++ :: How To Show At Least Two Numbers In The Output Instead Of One

Dec 12, 2014

I would like to know if there's a way to show at least two numbers in the output instead of just one. For example: instead of showing 4 it shows 04. Its for a console application.

View 3 Replies View Related

C++ :: Output Numbers As 2 Decimal

Feb 11, 2013

My program needs to be adjusted to send out the numbers as 2 decimal , but nothing work.

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int
number_ofstyle_American,
number_ofstyle_Modern,

[Code] .....

View 1 Replies View Related

C# :: Output Numbers In Different Order?

Mar 17, 2015

I am currently writing a program and am having some trouble figuring out how to get the order correct in the output.

Here is my code:

using System;
using System.Collections;
using System.Text;
namespace The_Last_Survivor {
class Program {
static void Main(string[] args) {

[code].....

The output I need to have is:

Actors Count Audition Order

1 1 1

2 1 1 2
2 2 2 1

3 1 1 2 3
3 2 2 1 3
3 3 3 1 2

4 1 1 2 3 4
4 2 2 4 3 1
4 3 3 2 4 1

[code].....

Right now the numbers are just printing in order 1-9 and not changing.

View 7 Replies View Related

C++ :: Program Won't Output Any Information To Text File

May 6, 2013

my program wont output any information to the text file that I have specified it just creates it but it leaves it blank

#include <iostream>
#include<string>
#include<iomanip>
#include <fstream>
using namespace std;
class Carloan

[code]....

View 2 Replies View Related

C++ :: Output Unusual Format For Text File

Jul 24, 2013

Bit of a problem, I'm trying to output the data from my code into a particular format to a text file. The format is

y0 y1 y2 y3 y4 y5...yn
z0 0.01 0.2 1
z1 0.4 0 etc...
z2
z3
z4
z5
...
zn

Any pointers?

View 1 Replies View Related

C++ :: Writing Output Of While Loop To Text File?

Jul 30, 2014

[URL] when I try to write my output to a file. I am building a life insurance premium calculator with c++. What my calculator does is read in a text file called "policies.txt" containing a number of different policies. For example:

Pol1 M N 20 100000 1 .04 99
Pol2 F S 30 100000 1 .05 99
Pol3 M S 72 750000 1 .03 99
Pol4 F N 45 1000000 1 .05 99

And using this, it creates a single premium. Once the calculator calculates the premium of each policy, I want it to write out the premium amount of each policy to a textfile called "output.txt". The problem is that when I check my "output.txt" file, only the premium for the last policy shows up. It only reads:

Premium for Pol4 is 220384
When I want it to read:

Premium for Pol1 is 14101.6
Premium for Pol2 is 14221.2
Premium for Pol3 is 582391
Premium for Pol4 is 220384

How come only the last policy is showing up? and is there any way to make all four policies appear in my output text file? Here is my code:

double ratesmn[86] = {
#include "MaleNonSmoker.txt"
- 1
};

[Code]....

View 2 Replies View Related

C++ :: Getting 2 Decimal Places In Output Text File?

Jul 30, 2014

how I can make my output only have 2 decimal places because I want it to be a monetary value. In my code I used this:

cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);

which worked well at first because on my command prompt screen the numbers had two decimal places and looked liked this:

Premium for Pol1 is $14101.62
Premium for Pol2 is $14221.16
Premium for Pol3 is $582390.50
Premium for Pol4 is $220384.49

However, I also have the program outputting to a textfile called "output.txt" and when I opened this text file the numbers only had one or no decimal places.

Premium for Pol1 is $14101.6
Premium for Pol2 is $14221.2
Premium for Pol3 is $582391
Premium for Pol4 is $220384

How come the code for two decimal places is working for my output to command prompt but not my output to the text file?

Here is my code.

double ratesmn[86] = {
#include "MaleNonSmoker.txt"
- 1
};

[Code].....

View 2 Replies View Related

C/C++ :: Read Text File And Display It In Output

Apr 7, 2014

I'm supposed to read a text file and display it in the output. I have it down except my formatting. I just cannot get it to just skip one line rather than multiple. I know why though because my char has a max of 11 and if I put a character lets say mango, it is going to fill in the rest with white spaces. It's supposed to display like this:

Mango
Strawberry
Grapes

But instead I get something like this

Mango

Melon

Grapes

I am using isspace but it's not working.

//source code

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <fstream>
using namespace std;
class CFile

[Code] ....

View 5 Replies View Related

C++ :: How To Output Void Function On A Text File

Feb 12, 2013

So I am writing this code that analyzes a file called "analysis.txt" and prints out in an ouput file (called "report.txt") the results of the analysis, i.e.,(the frequency of all alphabet letters present in the file).

I am having trouble with outputing on the file2.

here is what I have:

Code:

#include<iostream>
#include<fstream>
using namespace std;
ifstream file1;

[Code]....

I tried to lose the "<<" after the file 2, but it's still giving me an error. how to output a void function on a text file?

View 14 Replies View Related

C/C++ :: Adding Two Phone Agendas Together

Apr 4, 2015

I got this problem where I need to create a phone agenda where every name coresponds to a phone number. I decided to create this as a 2 dimensional string array.

But what I do not know how to do is:

I need to create 2 agendas(created in main(ag1 and ag2)) and then add them together to create one big agenda that contains the members of ag1 and ag2.

#include "stdafx.h"
using namespace std;
class Agenda{
string date[20][20];
public:
Agenda();
void afisare();

[Code] ....

View 1 Replies View Related

C :: Output Calculation (random Numbers)

Mar 24, 2014

Why do i keep getting wrong results

Code:
#include "stdafx.h"#include <stdio.h>
#include <string.h>
nt main(void){
char name[40];
int numbers[50];

[Code] .....

View 4 Replies View Related







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