I want to my program to prompt user to input a number with three or more integers I need the program to output a space between each numebr example: cin>>3334; i want the output to show 3 3 3 4 each with a space and then i also need to output the sum of these number so 3+3+3+4? how do i do this can some help me asap thanks a lot in advanced

Member Avatar
Member Avatar
+0 forum 11

as seen in the pic a table. I have the following im trying to fill the boxes based on rows. So line one will fill by the correct ordergoing left to right then down. here is my code. $results = mysqli_query($con, " SELECT * FROM PMAsset Order by Linenum, LineOrder") or die(mysqli_error($con)); while($row = mysqli_fetch_array($results)) { ?> <tr> <td bgcolor="aabbcc"><center><?php echo $row['LineNum']?></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php echo $row['PMStatus']?>></td> <td Bgcolor=<?php …

Member Avatar
Member Avatar
+0 forum 1

Hey guys, I would like some help regarding saving or reading to or from a bin file. I've read several online tutorials about file input/output, however it doesn't given specific information when applying it to both an array of structures. My knowledge of pointers is weak, as I constantly need to look over examples to get an idea of whats going on. Heres my attempt: [CODE] #define PLANET_SIZE 10 /* Called from function */ save(planet_t writePlanet[], *totalSize); /* define as int* totalSize */ read(planet_t *writePlanet); typedef struct{ char name[20]; }planet_t; /* Save to file */ void save(planet_t writePlanet[], int totalSize){ …

Member Avatar
Member Avatar
+0 forum 7

Hi I did a Simpletron program in GUI interface, but when I want to print the instructions in the window, it will not be as I want to. I used JGrasp to run the program and it just prints the instruction after each and not the way I wrote it in the program. For instance I want the program to be like: *** Welcome to Simpletron! *** ***Please enter your program one instruction*** ***(or data word) at a time into the input*** ***text field. I will display the location*** ***number and a question mark (?). You then*** ***type the word …

Member Avatar
Member Avatar
+0 forum 8

Hello All. I have a program that automatically restarts itself atfer a certain amount of time. I am doing this to test some things out. The program is wrapped in a jar. I run the jar from terminal with java -jar ProgramName.jar It will run and will output all the "System.out.println" outputs in terminal When the program restarts itself, It stops outputing on terminal. It runs fine and everything, I just want to see the output. How would I accomplish this. this is my restarting code. public void Restart() throws IOException { try { final String javaBin = System.getProperty("java.home") + …

Member Avatar
Member Avatar
+0 forum 2

Hello my friends. Look at this please: >>> from bs4 import BeautifulSoup >>> import urllib2 >>> url = urllib2.urlopen('https://duckduckgo.com/?q=3D&t=canonical&ia=meanings') >>> soup = BeautifulSoup(url) >>> links = soup('a') >>> print links [<a class="header__logo-wrap" href="/?t=canonical" tabindex="-1"><span class="header__logo">DuckDuckGo</span></a>, <a class="search__dropdown" href="javascript:;" id="search_dropdown" tabindex="4"></a>, <a href="https://duckduckgo.com/html/?q=3D">here</a>] >>> I used this `https://duckduckgo.com/?q=3D&t=canonical&ia=meanings` as the url, i thought the code above shoud do like this: Find all the links in that page of the internet, but you can see the result! As there are many links to different websites on that url page, so why it didn't print the url of each website into output?!

Member Avatar
Member Avatar
+0 forum 2

Hello! How can ask my scipt to print **every word** in a url page that starts with the letter "A" in this case? This is my code: from bs4 import BeautifulSoup import urllib2 url = 'http://www.thefamouspeople.com/singers.php' html = urllib2.urlopen(url).read() soup = BeautifulSoup(html) for word in soup.text: if soup.text.startswith('A'): print soup.text But it doesn't print anything for output.

Member Avatar
Member Avatar
+0 forum 10

Greetings, I'm having problems with my output. Essentially I am just trying to print out any Cat who is over 3 years old and has Claws. But my output keeps printing out either nothing at all or the 3rd cat 3 times. I've struggled with this for hours trying to figure out why.. any ideas? This is my driver java file. It will compile and run just fine but it doesn't work like it is supposed to.. import java.util.Scanner; public class NathanialProg6 { public static void main(String[] args) { Scanner input = new Scanner(System.in); Cat cat1 = new Cat(); Cat …

Member Avatar
Member Avatar
+0 forum 3

I wonder why this program does not do any changes to the text file that I am trying to modify. Scenario: My program uses the Fstream header file, I declared infile as IFSTREAM and outfile as OFSTREAM. I simply want to transfer data from infile to outfile. The data is as follows; Adam Larson 89 90 This data is saved in a text file manually created with Notepad. Furthermore, I also want to add the average of 89 and 90 into the outfile target file however, it doesn't do it. it does nothing at all. I also observed that there …

Member Avatar
Member Avatar
+0 forum 3

I need to have the same following format of dadat, which are read in a text fil, in output. "Mainnumber" is the first number of each matrix (1,2,3) and for each "mainnumber" (i), the number of rows are determined for each (i) by ("nof_row_per_mainnumber[i]"= numberof_rows;). For every "Mainnumber" (matrix) it starts from the first row ("first_rows[i]"= k;). The problem is that it says "numberof_rows" should be initialized. 1 2 3 2 4 5 6 7 3 8 9 3 5 2 6 class Classname { int mainnumber; int nof_row_per_mainnumber[3]; int numberof_rows; int first_rows[3]; double first_array[6]; double second_array[6]; int total_rows; public: …

Member Avatar
Member Avatar
+0 forum 4

I wan to wirte in cout << ... to have the matrix in output in the same format that I wrote it in text file like this: 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 class Classname { double data[3][3]; public: void Read(char *fname); void Writedata(); } void Classname::Read(char *fname) { int i, j; ifstream fin(fname); fin >> 3; // read the matrix for(i= 0; i<3; i++) for(j= 0; j<3; j++) fin >> data[i][j]; } void Classname::Writedata(char *fname) { // writes model to cout in same format it was read in cout << …

Member Avatar
Member Avatar
+0 forum 6

Hello, I have a code which generates QR codes from a csv file: #Importar base de dades pathFile = ('E:\Usuarios\Daniel\Documents\APNAE\QR\Llistat_socis_alta.csv') socisAPNAE = pd.read_csv(pathFile, delimiter = ';', encoding='ISO-8859-1') #generar codi QR for i in range(0,len(socisAPNAE.index)): soci = socisAPNAE.iloc[i,1:6] nom = socisAPNAE.iloc[i,1] nom = nom.encode('latin-1') qr = QRCode(version=20, error_correction=ERROR_CORRECT_L) qr.add_data(soci) qr.make() im = qr.make_image() im.save('E:/Usuarios/Daniel/Documents/APNAE/QR/test.jpeg') I would like to know how can I force the loop to rename the output file (test.jpeg, it is overwritten everytime the loop starts) with the string contained in the variable "nom". Can you help? Also, if you find a way to make the code nicer I'll …

Member Avatar
Member Avatar
+0 forum 3

Dear all, I have exists excel file on server. Now, I want output the file by php. I have this code: $file = "test.xls"; $file=basename($file); if (file_exists($file)) { header('Content-Type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$file); ob_clean(); flush(); readfile($file); exit; } When I click download button, I can open file, but appear "missing css file" dialog and content of this file have replaced by special character. Anyone help me? Thank you in advanced.

Member Avatar
Member Avatar
+0 forum 3

Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so far: def chartonum(ch): return ord(ch) - 97 def numtochar(n): return chr(n + 97) def two(c1 , c2): c1 = chartonum(c1) c2 = chartonum(c2) return numtochar(c1 + c2 %26) I am thinking I have messed up on my mod 26, however, I am at a lost where I might have went wrong in that. …

Member Avatar
Member Avatar
+0 forum 1

Is there a data type that can allow a user to input a 25 digit number... because the largest data type for numbers that i know is long long int and uintmax_t which can only store 18 numbers (i'm not sure about this)... because my problem should allow a user to input 25 numbers... If a larger data type is impossible, is there another way??? (I'm a beginner to c++ and i'm really sorry if this question sounds stupid) :)

Member Avatar
Member Avatar
+0 forum 5

hello again, so i want to make a programme where the file saved is saved with different names at every loop.. like at first loop it will save as file1.txt, 2nd loop file2.txt, so on... so this is my code... #include <iostream> #include <fstream> using namespace std; int main() { int x = 0; cout << "Hi" << endl; for (x == 0; x<10; x++){ fstream file; file.open("trial", ios::out); file<<"save it"; file.close(); } cin.ignore(); cout<<" DONE"; return 0; } so this is what the code is, it will loop 10 times and it will save it as file1.txt, file2.txt, file3.txt......... …

Member Avatar
Member Avatar
+0 forum 1

hi I am having trouble on echoing a sum from a table, The mysqul works and give me the wantted result and looks like SELECT sum(brick) FROM `goodship` this is the code i am trying to get to show it on the site, <html> <head> <?php $con=mysqli_connect("hostwiththemost.com","bulderbob","superscreatpassword","shipstable"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?> </head> <body> <?php $result = mysql_query($con"SELECT SUM(brick) FROM goodship"); while($row=mysql_fetch_array($result)) { echo $row['SUM(brick)'] ; } ?> </body> </html> any see why this is not working ? thanks.

Member Avatar
Member Avatar
+0 forum 6

I'm attempint to write a python application that will open a .csv file and look at comun one for certain string. If the string match print the row to a new .csv file. import csv input_file = csv.DictReader(open("stats.csv")) for row in input_file: print row

Member Avatar
Member Avatar
+0 forum 14

I’m trying to create a textbox, where the user enters a number, and the output shows a word representing each digit, each word is in an individual label created by the code, regardless of how many digits are entered. So if the user enters 153, the output will be: one five three I’m not sure how to break the input apart to separate each digit and create a label accordingly to the number of digits entered (e.g. if 3 digit number, create 3 labels). I know that after breaking the input apart, run those separated digits through case select, and …

Member Avatar
Member Avatar
+0 forum 14

Hello, is it possible to create a website that can **receive a command/word from the user**, and then **search other websites **for a file associated with that word? The file it provides would be based on selecting the file based on a set of **pre-defined criteria**. So the site would have to perform scanning/selecting actions in the background while outputting simply the file result to the user. Can a site perform these background operations such as scanning other sites then selecting a file? I’m very new but eager to learn and excited to read your replies, thank you.

Member Avatar
Member Avatar
+0 forum 2

Oh boy They ust be tired of me now. My trouble: I have two ArrayLists of custom classes. ``ArrayList<Subject>` **a**` ``ArrayList<Student>` **b**` Within those custom classes are other custom classes which themselves have primitive data types as well as an ArrayList of other custom classes. It's a big circus going on. How do I XMLEncode those two ArrayLists, **a** and **b**, so that all the information within them branching all the way down, is saved? (Also, is it possible to save both of these to the same file please?)

Member Avatar
Member Avatar
+0 forum 4

Hello, I've been trying to create a function to calculate and return the total payment. RadioDay is a radio button with value of 7 while RadioHour is 70. Somehow I am getting InvalidCastException "Conversion from string "" to type 'Integer' is not valid." from the part where I want to convert user inputs from textbox "txtByHour" and "txtByDay" into integer value. Any help is greatly appreciated. Function calcRate() As Integer 'calculate and return total payment for car Dim total, byHour, byDay As Integer byHour = CInt(txtByHour.Text) byDay = CInt(txtByDay.Text) If byHour > 24 Then 'making sure the user does not …

Member Avatar
Member Avatar
+0 forum 4

I've implimented this snippet of code dijkstra_shortest_paths( g, name2v[tempName1], get(&VertexProperty::predecessor, g), get(&VertexProperty::distance, g), get(&EdgeProperty::weight, g), boost::identity_property_map(), // index-map std::less<double>(), // compare std::plus<double>(), // combine std::numeric_limits<double>::infinity(), // infinity 0.0, // zero do_nothing_dijkstra_visitor(), get(&VertexProperty::color, g)); to use dijkstra's on a map created from a text file, but I have no idea how to output the vertex I start at to the next one required to be visited and the distance between them repeatedly followed by the total distance traveled. I can post any part of the code to assists with this. I think this may be required, this is what I used …

Member Avatar
Member Avatar
+0 forum 41

Hi All I am trying to find out the best way to capture the var_dump($contents) on line 29. I am think array? but I don't know how many string elements the array is returning. This is the output via var_dump($contents); array (size=45) 0 => string '.' (length=1) 1 => string '..' (length=2) 2 => string 'logs' (length=4) 3 => string 'index.html' (length=10) 4 => string 'executable' (length=10) 5 => string 'watkinshire' (length=11) 6 => string '.bash_history' (length=13) 7 => string 'beaumont_hire' (length=13) 8 => string 'aircon_london' (length=13) 9 => string 'aircon_london_test' (length=18) 10 => string '.htpasswd' (length=9) 11 => string …

Member Avatar
Member Avatar
+0 forum 3

I am trying to create stored procedure which will insert one row in the first table and identity of inserted row in other two tables. For some reason I am receiving error "Procedure or function expects parameter '@id', which was not supplied.". My code is as follows: ALTER PROCEDURE InsertProf ( @id int output, @added datetime2, @addedby nvarchar(50), @ime nvarchar(50), @prezime nvarchar(50), @fakultet int ) AS BEGIN SET NOCOUNT ON; declare @IdentityOutput table(ID int) INSERT INTO np_Profesori (Ime, Prezime) output inserted.IDProfesor into @IdentityOutput VALUES (@ime, @prezime) SET @id=(select ID from @IdentityOutput) INSERT INTO np_GdjeRadi (IDProfesor, IDFakultet) VALUES (@id, @fakultet) INSERT …

Member Avatar
Member Avatar
+0 forum 6

I don't have any errors, I have everything I need except the output which I want it to show on certain row and column. My prompt displays on row 7, column 33 and I want the output to be on on row 9, column 33. So right now instead of having the output on row 9 , column 33 it gives me to type a value on row 9 , column 33...I have called Gotoxy before calls to WriteString so I am not sure what I am doing wrong, and I have also tried to do mov dh, 9 mov …

Member Avatar
Member Avatar
+0 forum 1

Hi All, I have doubt in my mind regarding declaration of cin and cout object . As per my understanding cin and cout both object are accessible in main then they shouldn't have protected.in below code snippet i have overloaded both input and output operator and while giving new name (ofstream obj) to user defined version of this operator , I am getting error like obj is protected and can't be accessed here. Anybody can suggest . #include<iostream> using namespace std; class overload { public: int var_a; overload (int fun_a=10): var_a(fun_a) {} friend ostream operator >> (ostream &output, overload &); …

Member Avatar
Member Avatar
+0 forum 4

Hello, First of all apologies if this has been posted before, having trouble findin the answer, Let me start by inserting the code I have having the problem with, apologies if this isn't the correct way of doing things but I am still a newbie at php <?php include('config.inc'); mysql_select_db($dbname); $sql="SELECT * FROM db, 1st_reminder WHERE stage_two = '1' AND 2nd_email_sent = '0'"; $result = mysql_query($sql) or die(mysql_error()); $count = 1; while ($rows = mysql_fetch_array ($result)) { $to = $rows['contact_email']; $from = "email@domain.com"; $subject = "Subject"; $message .= $rows['1st_body']; $headers = "From:" . $from; mail($to,$subject,$message,$headers); if ($count % 5 == …

Member Avatar
Member Avatar
+0 forum 4

I'm trying to create a program where I can print output to my console application and entering test without being override. Is there anyway to accomplish this? Here is my simple code showing my issue: ` #include <iostream> #include <thread> #include <Windows.h> void myThread() { while (1) { std::cout << "hello world" << std::endl; Sleep(1000); } } int main() { std::thread t1(myThread); while (1) { std::cin.get(); } return 0; } `

Member Avatar
+0 forum 0

Hello! I am creating an assembly program that accepts a single character and displays the alphabet in reverse. The requirements are (1) The input character should be displayed (2) The alphabet should be displayed vertically and (3) Only the letter 'Z' should be accepted as input. I have managed to let my program input a character and display the alphabet in reverse however, it is displayed horizontally. I made a proc named nlcr for new line and carriage return but when I call it inside the loop, some weird characters appear. Also, I have not yet made a validation process …

Member Avatar
Member Avatar
+0 forum 3

The End.