Questions tagged [sentinel]

A sentinel is a loop exit value or list delimiter whose value is outside the range of valid input, such as -1 for a zero-based array index, or ~ for alphabetic strings.

410 questions
-1
votes
1 answer

Homework assignment with error with sentinel loops

Ok, so I am working on this class assignment where I have to write a program that uses a sentinel value controlled loop to input student scores and displays the count of students and the average of all scores when a -1 is entered. A title is to be…
-1
votes
2 answers

Replacing an Element

I'm working on code that shows the simple operation of an array. I can't seem to make it work at the part of re-inserting a deleted element inside my created array. My goal is to put another element inside another deleted element (when I delete an…
-1
votes
2 answers

How to fix infinite loop with struct in C

I have a problem with the struct when storing data. I want to make a sentinel loop so please have a look and help me thank you. #include #include struct Vehichle { char vecType[100]; char plateNo[10]; float…
-1
votes
1 answer

Java - Issue with Comparing Strings for Sentinel Values

Having a simple issue with my while loop and sentinel value not registering. I have come to the conclusion that my issue lies with my while loop, or maybe the assignment of user input. The basic idea of my program is that I have a 2D array with…
-1
votes
2 answers

How to list input values after the loop is done?

It is supposed calculate the sales commission based on input variables and list them after the loop is done. I am unsure how to go about listing the values of totalEarned after because they change when the loop is done. import…
jimjab
  • 9
  • 2
-1
votes
2 answers

Java while loop sentinel issue

My while loop runs fine and the sentinel (String End) value ends the loop...the issue is that the when the sentinel is entered, the else println statement occurs. I want the sentinel value to end the loop and not have the final else statement…
Rye Guy
  • 45
  • 2
-1
votes
1 answer

C++ dynamic array for continuous string input

I need to make a dynamic array in C++, and ask a user to input a name until the user types exit. It should keep asking for more and more names, recording them to a dynamic string array, then randomly choosing as many names as the user wants from the…
-1
votes
1 answer

No [login] credential was passed - Laravel & Sentinel

I have started a new project with Laravel, and after I included Sentinel and tried to register a new user, it keeps showing me this message: No [login] credential was passed. What Login credentials, I'm registering new user?? I'm using the latest…
-1
votes
1 answer

Method [sendEmail] does not exist

I am new to laravel 5.3 . I am using cartalyst sentinel for authentication Web.php Route::post('/register','RegistrationController@register'); Route::get('/activate/{email}/{activationCode}' ,…
Gagandeep
  • 83
  • 2
  • 18
-1
votes
3 answers

How to Calculate How Many Times Inputs Entered in Sentinel Loop c++

Here is the link to the programming question for detail. I have done my source code but I don't know how to calculate and display how many times inputs are entered in sentinel loop. Here is my source code: #include using namespace…
-1
votes
2 answers

sentinel loop execution in c

I have the following code and I would like it to break after entering the sentinel number only once but at the moment I have to input the sentinel number twice for the code to break. Any ideas? #include // Include a standard C…
drez
  • 5
  • 3
-1
votes
1 answer

Why does my C++ sentinel loop continue after the sentinel value is entered?

When I enter the string "NOMORE" it continues to the next line where it asks me for the vehicle speed. It only stops the loops when it finishes the for loop. How can I make it so that it stops immediately when "NOMORE" is entered? Thanks for any…
-1
votes
1 answer

How to get Sentinel logged user to front-end

I want to get the sentinel logged user to front-end. In my front-end blade PHP I used Sentinel::check() method. But it return false. When I check the same condition in the controller class it return true. So I want to find out how to get the logged…
-1
votes
1 answer

gets not receiving input in Ruby

I have a sentinel controlled loop that does not seem to be taking in any input whatsoever: response = " " until response == "x" do puts" Xargonia ========= (N)ew (L)oad (O)ptions (Q)uit" reponse = gets puts response When it tries…
Lexo18
  • 11
  • 2
-1
votes
2 answers

Why do some sentinel loops require break to terminate? c++11

I have a loop that looks something like this int temp = 0; int menuItem; while (temp != -1 && temp < 5) { cout << "Order " << temp + 1 << ": "; cin >> menuItem; arrayData[temp] = menuItem; temp++; break; } When I learned to use…
Podo
  • 709
  • 9
  • 30