Question

I am working on c # but I need to verify if a void type meets...

I am working on c # but I need to verify if a void type meets a condition to follow instructions but I don't know how to do it, I was trying to do it with an if in the following way but it gives me error someone could help me, or tell me how I can check the condition :(

if ((lex.addtoken(analisis.Type.Words_Reserved_Planificador) == true)&&(lex.addtoken(analisis.Type.Symbol_Two_Points)==true)) { //Type is class Enum

instruccions

}

else

{

Console.WriteLIne("Error :(");

}

Homework Answers

Answer #1

It would be great if the entire program was given. With the source code it would be easier.

You can use ' if ((lex.addToken(analysis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analysis.Type.Symbol_Two_Points))) ' in order to check if there is any returned value of the function by deleting true as the return type.

If the return type is anything other than void then the ' if ' block instructions will be executed. If the return type is void then the ' else ' block will be executed.

For example,

if ((lex.addToken(analisis.Type.Words_Reserved_Planificador))&&(lex.addtoken(analysis.Type.Symbol_Two_Points)))
{

instructions

}

else

{

Console.WriteLine("Error :(");

}

Hope this helps.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I am working on c # but I need to verify if a void type meets...
I am working on c # but I need to verify if a void type meets a condition to follow instructions but I don't know how to do it, I was trying to do it with an if in the following way but it gives me error someone could help me :( if ((lex.addtoken(analisis.Type.Words_Reserved_Planificador) == true)&&(lex.addtoken(analisis.Type.Symbol_Two_Points)==true)) { instruccions }else{ Console.WriteLIne("Error :("); }
I am trying to figure out the correct formula in statistics that I need to use...
I am trying to figure out the correct formula in statistics that I need to use for this question. When you or anyone else attempts to tell me and my associates that 1223 persons account for our opinions and tastes here in America, I get mad as hell! How dare you! When you or anyone else tells me that 1223 people represent America; it is astounding and unfair and should be outlawed. The writer then goes on to claim that...
MATLAB question and do not change subject. if you dont know skip I need a working...
MATLAB question and do not change subject. if you dont know skip I need a working MATLAB code which will tell me the type of damping which is present in the system. there are 3 types of damping . use if else and give the result. take mass stiffness damping coefficient as input. Dont post wrong answer of i will badly dislike
Hello! I am coding in c# and I am having trouble using boolean variables and if...
Hello! I am coding in c# and I am having trouble using boolean variables and if statements. The project I am working on is based on the users input, and the code should branch into two different options. However, I am struggling to understand how to take the users input to decide which path to take. Another problem I am having is with my if statements. After the user has inputed information and the code decides to take them down...
I am trying to solve the following C++ problem over structures. I am having trouble with...
I am trying to solve the following C++ problem over structures. I am having trouble with the very last structure and I made a comment next to where I am confused. I included the assignment instructions and my current code. I would appreciate if anyone can help me explain what I need to do for the last structure. Thank you. Assignment Instructions Create a program that will prompt me for each of the following items: 1. Date of Birth 2....
I need to sum a looped listbox in C#. I am adding a snip of my...
I need to sum a looped listbox in C#. I am adding a snip of my code. The user is to input the number of days that were worked. You get paid .01 for the first day and then that amount doubles per day worked. The code I am posting already does what it is supposed to do - it displays a list with the numbers of days worked with the amount of pay for that day listed beside it....
C Programming: I am working on the problem below and have got all of the code...
C Programming: I am working on the problem below and have got all of the code down, except for one part I can't figure out. The logic for the calculation where the the total at each shop is giving after each iteration of the loop. this is the formula I've got: ingredientPrice += ingredient1; It calculates the total for the first shop properly, but for the shops that follow it gives a cumulative total rather than the singular total for...
Question: I get a Segmentation fault error sometimes when I addElementBack or print. Am I using...
Question: I get a Segmentation fault error sometimes when I addElementBack or print. Am I using pointers correctly and deleting memory properly? #ifndef DYNAMICARRAY_H #define DYNAMICARRAY_H #include <cstdlib> #include <iostream> using namespace std; // Node class class Node { int data; Node* next; Node* prev; public: Node(); Node(int); void SetData(int newData) { data = newData; }; void SetNext(Node* newNext) { next = newNext; }; void SetPrev(Node* newPrev) { prev = newPrev; }; int getData() { return data; }; Node* getNext()...
I am having a problem with this one error. I have to turn this in tonight...
I am having a problem with this one error. I have to turn this in tonight and this is holding me up right now. Just not sure how to fix it. .VS 2019 .net framework windows forms private void DisplayForm_Load(object sender, EventArgs e) { if (File.Exists("Employee.txt")) { using (StreamWriter sr = new StreamWriter("employee.txt")) { string employeeId = ""; while ((employeeId = sr.ReadLine()) != null) { Employee employee = new Employee(employeeId, sr.ReadLine(), decimal.Parse(sr.ReadLine()), decimal.Parse(sr.ReadLine())); Employee emp = employee; employeeListBox.Items.Add(emp); allEmployee.Add(emp); }...
Create a field with the boolean value of goodBoi. In the constructor, set your good boi...
Create a field with the boolean value of goodBoi. In the constructor, set your good boi to being false, as all dogs has deserve being called a good boiii. Make a method makeGoodBoi, which sets the good boi value to being true. Make a method isGoodBoi which returns the value the good boi field (hint: it returns a boolean value). Now we need a method called whosAGoodBoi. If the doggo is indeed a good boi, then print: "[doggo] is such...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT