I for the life of me can't get my logic straight. I have 2 lists, 1 a list of text, and the other a list of int.
Here's my main list: List<string> ListNeedToADD = ListOfSPSExt.Except(ListOfReportExt).ToList();
Here's my second list:IEnumerable<int> result2 = Enumerable.Range(1, Convert.ToInt32(myValue)).Except(hostList);
I need to loop through my main list, ListNeedToADD, and for each item in that list, grab 1 value from the 2nd list and send those 2 items to a method. Something like this:
The problem with doing it the way I am above is it loops through ALL the items for each myString.
For my method, it needs to look like this: insertReportLimits(attribTable, "34257", 22, con); then it would move on to the next: insertReportLimits(attribTable, "34854", 27, con); etc etc.
We are making a program--but every time we input a value for scanf, the following for loop does not work and the program quits without displaying the for loop's function. We are not getting any errors.
I have tried to submit this topic before but i didn't submit my whole code and it was removed. So here it is. All I am trying to do is load form2 from form1 then back to form1 from form2 for a certain number of times the get out of the loop. I am new to C-Sharp and it seems as though I cant seem to figure out a way to do this.
Here is form1 and form2 code. I have commented out a few things I have tried.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;
I already made a nested for loop into a while loop (below this) and now I'm trying to make the outer for loop into a do while loop, but it's not working.
#include <iostream> using namespace std; int main () { int len; int j; int i;
[Code]....
And I can't make this code do the same thing. It stops after one loop, instead of continuing to the end. Why won't the loops continue?
#include <iostream> using namespace std; int main(){ int len; cout << "Enter a number: ";
I can't get out of my loop to fill the array. This array should stop and print after 10 inputs. but it keeps asking for input.
This is what my code is supposed to do. Use 0 as sentinel for an array. Only positive ints will be entered into the array. A negative int should result in an error message, then input will continue. The numbers will be inserted into the array in ascending order. Do not insert them then sort the array.
#include <iostream> #include <cmath> using namespace std; const int arraySize =10;
I am using a for loop to count down from 10 to 0 it's working to count down from 10 to 1 but when the program cames to the 0 then the program freezes by any reason.
Code: #include <iostream> using namespace std; int main() { int number[2]; cout << "Enter number: "; cin >> number[0]; if (number[0] == 1)
What I need to do to get rid of the infinite loop?
Code: do { printf("Enter the number of tests:"); scanf("%d", &test); if (test< 0 || test> 4) printf("Wrong number. Please try again! "); } while (test< 0 || test>4);
I'm writing a program to sum up the even numbers in between 1 and 100, using a while loop. At the beginning of my program, I initialize a variable "sum" to 0, and a variable "temp" to 1. Afterwards I enter a loop where I determine if "temp" is even or not, and if so add it to sum. However, at the end of my program, when I print "sum", I get a result of 0. Below is my code.
Code:
#include <stdio.h> int main(void) { int sum = 0, temp = 1; }
While trying to redo everything in c i have an error on a do while loop and i don't understand i've corrected everything else but i don't understand why the error occurs even though it says how to fix it it says error expected ) before token -line 18 part of code
Code:
int main(){ Beep (523,1000); // sound at 523 hertz for 1 000 milliseconds char cPresent; do }
[code]....
this is just extra bits i've added on to the assignment but I've worked on the c++ code for a week now i have less than a day to redo it
This is an example from C++ Primer on while loops shortened for simplicity:
int main() { int value = 0; while(cin >> value) cout << value; return 0; }
When I compile and run the above code the program keeps asking for input after I input nothing but pressing ENTER no matter how many times. The only way I can get it to stop asking for input is to input something other than an int such as a char or string. Program executes as intended after that. I have googled this issue and read all seemingly relevant results and nothing seems to pertain to my exact problem. I think it may have something to do with my computer's own settings or something and am baffled as to what it may be.
I need to write a complete program using "While Loop" to calculate 1! to 12! using just "int" variables. Only from 1 to 12 and there are no other inputs.. This is my first time using While loop.
Write a C++ program that uses a while loop to guess a persons age, ask the user if the want to try again if no end the loop. Of course if they guess it the loop also ends
I am writing a program to tell how long it will take for a loan to be paid off supposing the desired loan is 100,000, the annual percentage rate is 6, and the monthly payment is 1,000. What happens is after I run the program, I get the output of "-24.60" after the last month is paid off. I'm trying to get it to where the last monthly payment is only enough to make the loan 0. Then I want the program to end.
#include <iostream> #include <iomanip> using namespace std;
I am working on a program that is supposed to do I/O file streaming. I dont know if I can properly explain how its supposed to work but I have found the error on my code, I just dont know WHY the error is happening? If you look in the while loop, count changes values like it should, but MOVE and TIP doesnt. Count starts at value 2. So move is 108. Then count becomes 4, but move stays at 108?
Move wont change its value? It stays 108, causing this infinite while loop. Where is the error in my code to cause move to not change values like count does?
I seem to be struggling with I/O File streaming :(
#include <iostream> #include <vector> using namespace std; const long nx(3); const long ny(3); const long seal(-1); long TotP(0); class pore {
[Code]...
I can print out all those TotP, but cannot get Finish loop print out, why? If I put any statement below, which seems won't be executed, it is like it never jump out from the loop and die inside.