1.Write Psuedo Code for your Summer Vacation
Includes 3 different variables and they must be assigned and used
Include at least 2 different IF statements
Include one LOOP
PROGRAM count and print even odd numbers from 0-10
j=10;
evenCount=0;
oddCount=0;
FOR i=1 to j DO
IF(i%2==0)
THEN
evenCount=evenCount+1;
END IF;
IF(i%2!=0)
THEN
oddCount=oddCount+1;
END IF;
END FOR
Print evenCount;
print oddCount;
END
if you like the answer please provide a thumbs up.
1.Write Psuedo Code for your Summer Vacation Includes 3 different variables and they must be assigned...
Write simplistic recursive Java code for Sierpinski I made a psuedo code tell me if anything wrong with it: // x - left edge, y - right edge, z - peak, num - number of times the program is supposed to run public void drawTriangle (int x, int y, int z, int num) maketriangle(x,y,z); //imaginary method to create triangle using coordinates. if (num == 0) { return; } else { int midxy = (y-x)/2; int midxz = (z-x)/2; int midyz...
1. Please write the following in Python 3 code. Also, write code and not psedo code. Also, show all outputs and share your code. Question: Create one conditional so that if “Friendly” is in w, then “Friendly is here!” should be assigned to the variable wrd. If it’s not, check if “Friend” is in w. If so, the string “Friend is here!” should be assigned to the variable wrd, otherwise “No variation of friend is in here.” should be assigned...
Assignment • No variables declared after you start writing code, must be declared at the top. • Reuse all the variables from the first half in the second half, do not make up new variable names. • You code must be properly formatted. • You must use the code provided and variables names provided and not add any more variables to your code. • No for(int I = 0; … no declaring variables except at top of code. • You...
Two variables named largest and smallest are assigned for you. Use these variables to store the largest and smallest of the three integer values. You must decide what other variables you will need and initialize them if appropriate. Write the rest of the program using assignment statements, if statements, or elif statements as appropriate. There are comments in the code that tell you where you should write your statements. The output statements are written for you. Execute the program. Your...
1) Write a code segment that provides at least three possible outcomes (i.e., IF with a couple of ELSE blocks). 2) Write a FOR loop that would cause a section of code to be executed 10 times. 3) Write a WHILE loop that would cause a section of code to be executed 10 times. 4) What is a variable? 5) Name 5 different “data types” used in C++ programming.
write a for loop that does something. You would need to write that code syntactically correct for that loop to include any variables needed or used. You would not need to write main, or pre processor directives or #define constants etc. Likewise, you will be asked to write a function. The function definition includes the header and the body of the function. You would not need to write main or the calling function or the function declaration. I need to write...
01) Write PIC24 assembly language equivalents for the Sollowing C code fragments. Assume variables u16 iul kal6 j.ul6 n are uintl6 variables, while uš p, u8 q, u8 rare uin variables 1. Code fragent 2. Code fragment . Code frapent (use place holders for if-body, else-body) if-body statements else-body statements 4. Code fragent (use place holders for if-body, else-body) if-body statements l else I else-body statenents 5. Code frapent (use place holders for loop-body) &. Code fragent (use place holders...
CODE MUST BE IN C 1. Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alreadybeen declared, use a while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total. Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total. Use no variables other than n, k, and...
LAB 2 SUBJECT: Algorithms, Compiling, Debugging Goal: Enter and compile a program. Write an algorithm (psuedo code) to calculate the shaded area of the object below Algorithm should be general: It should work for all values of A,B,C,D and different number of boxes (drawing below shows 3 x 3 shaded boxes and 1 x 1 white boxes). Do not assume A=B or C-D (as shown in the first diagram). Do not assume that the boxes are 3x3 and 1x 1....
Java code. Need help with either 1. or 2. Nothing too
complicated and the code needs at least one loop and 3 switch
statements!
Artificial Intelligence elements in programming. Creating stories with user input. For this assignment, you can do one of two things 1. Create a chat box that allows a conversation to go on as long as the user wants . Welcome the user when they start. . look for key words or other things that could guide...