Q: Draw the graph from the given adjacency matrix and find the Breadth first Search and Depth First Sea...
A: Steps: 1) plot all the vertices 2)consider each vertex at a time and draw all the edges going out o...
Q: C++ code not Java
A: There should be two parameters array and number of elements and it has to return maximum
Q: C++ code
A: Solution : The correct definition of array is option A i.e float array[] = {0.4,0.2,1.5}
Q: Question 10 In C++, which of the following objects need to be used in order to open a file for readi...
A: B) ifstream
Q: Java
A: Program:- import java.util.*;public class Main{ public static void main(String[] args) { Sca...
Q: Java please
A: A constructor is a special method of a class. The constructor will have the same name as the class n...
Q: c++
A: Program #include <cstdlib> #include <iostream> #include <fstream> using namespac...
Q: What is the output of the following code: int main() test1(): test10: return 0; void test1 () static...
A: The correct answer for the below program is “C” 1 8 3 8
Q: Can help Find the bridge, the cycle, the route and the road
A: Answer: a).Bridge in the above graph:- Bridge basically helps to connect two components in the graph...
Q: C++ code 3
A: The syntax for a nested for loop in c++ is: for ( init; condition; increment ){for ( init; condition...
Q: Given the ES=3050H, SS=1298H, CS=ABC3H determine the physical address for a) SP=2583H b) DI=3399H c)...
A: Given Data : ES=3050H, SS=1298H, CS=ABC3H Formula used for physical address : Physical address ...
Q: Find a grammar for the C Programming Language. Grammar at least includes reading all programs such a...
A: Grammar for C language
Q: C++
A: Correct Option: A, C #include <iostream>using namespace std; int main() { int a[][3]={1,2,3,4,...
Q: C++ code not Java
A: I have given the answer below.
Q: Suppose you are building a Java application for storing the names and ages of children in a family. ...
A: The application to be created will be a java application that will keep track of the names and ages ...
Q: In Java, method overloading means that a program may contain more than one method with same signatur...
A: Method overloading In Java, method overloading gives the capability to more than one method to share...
Q: Convert the following regular expression to DFA(deterministic finite automata) b(∈+(a+b)∗(c+∈)(a+b...
A: Steps: 1) Determine the minimum number of states required in the DFA.2) Draw those states.3) Decide ...
Q: Suppose you are building a Java application for storing the names and ages of children in a family. ...
A: Data types define what kind of data can be stored in a given data element. The first strategy for se...
Q: (2) Extend to output the input squared and cubed. Hint: Compute squared as userNum * userNum. Enter ...
A: Below is the code for the above output : import java.util.Scanner;public class OutputWithVars{ pub...
Q: Principles of Information Security True or False Q : Unknown exploits have a confirmation of and mea...
A: Information security is referred to as collection of processes applied to secure and safeguard elect...
Q: Correct errors if any and print output
A: *p refers to a pointer variable p
Q: I need explanation on how this code works...that is explaining the code and how it works
A: (i) The testbench is also known as the testing workbench. (ii) It is used to check the accuracy and ...
Q: Question 4 The correct prototype for the following function heading is void F1(int x], int yO[10]), ...
A: Given: A function is given which takes some arguments. Goal: We have to check whether the given func...
Q: differences between hard and symbolic links.
A: Underneath the file system files are represented by inodes .A file in the file system is basically a...
Q: Write a program that reads a positive integer number N in therange 0 < N ≤ 19. If ? is outside th...
A: Code : import java.util.*; class RowColumnProgram { public static void main(String[] args) { ...
Q: Write a program in C++ which prompts user to enter a string of text of one or two lines. Once entere...
A: Approach: 1) Take the input ( sting and word) 2) Call the function doit(). 3) print the result. doit...
Q: 2) Write a java program to print following pattern using inner loop concept 35 7 9 11 13 15 17 10 12...
A: Programming instructions: Create an int variable for the number of lines. Create a scanner object f...
Q: C++ code not Java
A: Continue statement: This statement will skip the current iteration and forces the next iteration of...
Q: Computer Science Question
A: The first query should validate the the ASSIGN_CHARGE values in the ASSIGNMENT table. ASSIGN_CHARGE...
Q: SUBJECT: OPERATING SYSTEM
A:
Q: Define a class with the following specifications: Create a class called MarathonRunner that has thre...
A: Actually, program is a executable software that runs on a computer.
Need explanation of this code..that is explain the code and how it works
Step by step
Solved in 2 steps
- Please could you write a programming code for the servo motor, in order to make the ultrasonic sensor move around to detect obstacles. Please insert it into this programming code // Define pins for sensors and output devicesconst int waterDetectionSensor = 12; // Water detection sensorconst int ultrasonicSensorTrigger = 13; // Ultrasonic sensor trigger pinconst int ultrasonicSensorEcho = 14; // Ultrasonic sensor echo pinconst int infraredSensor = 15; // Infrared proximity sensorconst int buzzer = 16; // Buzzerconst int vibratorMotor = 17; // Vibrator motorconst int ledGreen = 18; // Green LEDconst int ledRed = 19; // Red LEDconst int toggleSwitch = 21; // Toggle switchconst int powerJack = 22; // Power jack // Define variables for sensor readingsint distance;int infraredValue;int waterValue; void setup() { // Initialize pins pinMode(waterDetectionSensor, INPUT); pinMode(ultrasonicSensorTrigger, OUTPUT); pinMode(ultrasonicSensorEcho, INPUT); pinMode(infraredSensor, INPUT);…When the switch button (PF4) is pressed, the LED has to light up. When the button is released, the LED switches off. Following press of the button turns on a different color LED light. 0x10 -> OFF, 0x12 -> RED, 0x14 -> BLUE, 0x16 -> MAGENTA, 0x18 -> GREEN, 0x1A -> YELLOW, 0x1C -> CYAN, 0x1E -> WHITE. Write a counter function for a microcontroller that would count from 0x10 to 0x1E incrementing with every button press. Sample code: #include <stdio.h>#include <stdint.h>#include "tm4c123gh6pm.h" int main(void){SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;//(PF1 - PF3)GPIO_PORTF_DIR_R = 0x0E;//(PF1 - PF4)GPIO_PORTF_DEN_R = 0x1E;//(PF4) pull upGPIO_PORTF_PUR_R = 0x10; while(1){if(GPIO_PORTF_DATA_R & 0x10)GPIO_PORTF_DATA_R &= ~(0x0E);elseGPIO_PORTF_DATA_R |= (0x0E);} return 0;}RGB LED fading colors project. Write comments for the below C code explaining each line. Code is below ?? #define GREEN 5 #define BLUE 3 #define RED 6 void setup() { pinMode(RED, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BLUE, OUTPUT); digitalWrite(RED, HIGH); digitalWrite(GREEN, LOW); digitalWrite(BLUE, LOW); } int redValue; int greenValue; int blueValue; void loop() { for( int i=0; i
- Consider circuit diagram and the program below.. Note:this two pictures of the circuit its shows the connections on one diagram, Make use of the comments to complete the program by selecting the correct option to complete the missing or incomplete statements: Let incomplete statements be [..................]. (number) so that you can see them while reading the code // include the LCD library [......................]. (1) // create a variable for controlling brightnessint ledBrightness; // create a variable for reading the switch valueint sPin = 12; // this is the initializing of the lcd libray and interface pin [..........................] .(2) void setup() { // setup the lcd as a 16 character by 2 row display [...........................] .(3) // setup the switch pin to be an input pinMode(sPin, INPUT);} void loop() { // refresh the LCD first row lcd.setCursor(0,0); lcd.print(" "); // read the values coming from our sensor int tempSens =…Computer Science Code a Binomial Expansion Calculator in Visual Studio using Windows Forms.app (.NET Framework). UI must have 3 radio buttons, n = 2, n =3 and a custom n value. 3 textbox inputs (a, b, and for n which must only be enabled when radio button custom n value is selected. Outputs – must include a label that should dynamically change depending on the value of a, b &n (e.g. “The binomial expansion of equation (ax + by) of power n is:”). This should not be editable.Consider circuit diagram and the program below.. Note:this two pictures of the circuit its shows the connections on one diagram, Make use of the comments to complete the program by selecting the correct option to complete the missing or incomplete statements: Let incomplete statements be [..................]. (number) so that you can see them while reading the code Answer only [...........]. (7)..,[............].(8)..,[...............].(9)... // include the LCD library [......................]. (1)..... Answered // create a variable for controlling brightnessint ledBrightness; // create a variable for reading the switch valueint sPin = 12; // this is the initializing of the lcd libray and interface pin [..........................] .(2)...... Answered void setup() { // setup the lcd as a 16 character by 2 row display [...........................] .(3)...... Answered // setup the switch pin to be an input pinMode(sPin, INPUT);} void loop() { // refresh the LCD first…
- Create a plot of 6 (Six) Points so that a Graham Scan Sequence runs exactly as follows: push/push/push/push/POP/push/POP/POP/push Do not need to write/code a program! Only need a plot of 6 points that works with that sequence!In visual basic, or Visual Studio Create the following output using nested For…Next loops: 1 6 11 16 2 7 12 17 3 8 13 18 4 9 14 19 5 10 15 20 Write a nested For…Next loop to create the following pattern: 1 1 2 1 2 3 1 2 3 4 1 2 3 4 55. Make a button that toggles an LED on or off when pressed. Use only Arduino C++ Code!
- Test.py ## test# 3 * 3 grid : boardgrid = [' *','* ','*','*','*','*','*','*','*'] # we have two players denomted as "X" and "O" play=Truecount=0 while play:# add first playeradd_x=True# loop to add playerwhile add_x:# at which postion you would like to add the playerplayer_postion_x=int(input ("Enter postion for player X: "))## add X player into the boardif grid[player_postion_x-1]!="X" and grid[player_postion_x-1]!="O":grid[player_postion_x-1]="X"add_x=False#to count the number of added playerscount=count+1else:print ("The postion has been taken")if grid[0]=="X" and grid[1]=="X" and grid[2]=="X":print ("Player X win")print(grid[0:3])print(grid[3:6])print(grid[6:9])breakelif grid[3]=="X" and grid[4]=="X" and grid[5]=="X":print ("Player X win")print(grid[0:3])print(grid[3:6])print(grid[6:9])breakelif grid[6]=="X" and grid[7]=="X" and grid[7]=="X":print ("Player X win")print(grid[0:3])print(grid[3:6])print(grid[6:9])breakelif grid[0]=="X" and grid[3]=="X" and grid[6]=="X":print…Please don't use the online code to flowchart maker because it is not accurate.Create a flowchart for this Java Program import java.awt.*;import java.awt.event.*;public class Counter extends Frame implements ActionListener {Label label;TextField text;Button cu, cd, rst;int count;Counter() {count = 0;label = new Label("Counter:");label.setBounds(30, 70, 70, 30);text = new TextField("0");text.setBounds(100, 70, 110, 30);cu = new Button("Count Up");cu.setBounds(220, 70, 110, 30);cd = new Button("Count Down");cd.setBounds(330, 70, 110, 30);rst = new Button("Reset");rst.setBounds(440, 70, 110, 30);cu.addActionListener(this);cd.addActionListener(this);rst.addActionListener(this);add(label);add(text);add(cu);add(cd);add(rst);setSize(580, 150);setLayout(null);setVisible(true);}public void actionPerformed(ActionEvent e) {if (e.getSource() == cu) {count++;text.setText(String.valueOf(count));} else if (e.getSource() == cd) {count--;text.setText(String.valueOf(count));} else if (e.getSource() ==…C++ must answer properly also do attach output screenshots