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 am working on a JSON WPF program-C#... I have 2 objects that I am concatenating....
I am working on a JSON WPF program-C#... I have 2 objects that I am concatenating. All I need to know is how to format the first block of code to where the data types match. Here is what I have: I need to take this: A.) { “Name” : “Walder” , “Alias” : “Hodor” , “Alliance” : “House Stark” } and this: B.) { “Name” : “Margaery Tyrell” , “Alias” : [ “The Little Queen”, “The Little Rose”, “Maid...
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....
Java program question! If I pass null to a method, how can I use the passed...
Java program question! If I pass null to a method, how can I use the passed value to compare. Here is example code, it might be wrong, please make it could run on eclipse. Public class hw{ public static void main (String args[]) { method1(); } private static void method1() { System.out.println(method(null)); } public static String method(int[] a) { return null; } What I want to get in the output is just "()". It is not just to type the...
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()...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT