Coursehelp
April 20, 2019

## (Solved) : Code Review Review Code Metalplatetempcpp Attached Program Listing Information Required Un Q30758632 . . .

Code Review:

Review the code (Metal_Plate_Temp.cpp) in the attached programlisting. As it should be, all the information required tounderstand this program is included in the code comments. Below isa screen-shot for the program’s expected output.

Project Requirements:

Your objective for this coding problem is to implement the codefor main() along with the user defined function in plate.cpp &plate.cpp.

You must submit the FULLY DOCUMENTED source code for the threesource files (Metal_Plate_Temp.cpp, plate.cpp & plate.h).

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Name : Metal_Plate_Temp.cpp
// Author : Dr. George H. Zion
// Course : Computation Problem Solving II (CPET-321)
// Date : Fall 2018 (2181)
// Description :
//
// Under steady-state conditions, the temperature at any point onthe
// surface of a metal plate will be the average of the temperaturesof
// all the points surrounding it. This fact can be used in aniterative
// procedure to calculate the temperature distribution at allpoints on a
// plane.
//
// Figure #1 shows a square plate divided into 100 squares or nodesby a
// grid. The temperature of the nodes form two-dimensionalarray.
//
// 9 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 8 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 7 [ ][ ][X][ ][ ][ ][ ][ ][ ][ ]
// 6 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 5 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 4 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 3 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 2 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 1 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 1 2 3 4 5 6 7 8 9
//
// Figure #1
//
// The temperature at all nodes at the edges of the plate areconstrained
// to 20 degrees Celsius by a cooling system, and the temperatureat the
// node (2,7) is fixed at 100 degrees Celsius by exposure toboiling water.
//
// A new estimate of the temperature T(R,C) at any node can becalculated
// from the average of the temperatures of all nodes surrounding itusing
// the formula in Equation #1.
//
// T(R,C)new = 1/4 ([ T(R+1, C) + T(R-1), C) + T(R, C+1) + T(R,C-1)]
//
// Equation #1
//
// To determine the temperature distribution on the surface of aplate,
// then equation #1 is applied to calculate the new temperature atthe
// node. These updated temperatures are, in turn, used to calculatenew
// temperature. This process is repeated until all new temperaturesat
// each node reach a steady-state.
//
// This program calculates the steady-state temperaturedistribution
// throughout the plate, making an initial assumption that allinterior
// segments are at a temperature of 50 degrees Celsius (Rememberthat
// all outside segments are fixed at 20 degrees Celsius and thenode (2,7)
// is fixed at 100 degrees Celsius).
//
// The program follows the following algorithm/pseudo-code:
//
// 1) Display the temperatures of the plane (initialconditions).
// 2) Display an ‘*’ on the screen.
// 3) Perform one interation of new temperature calculations
// for the plate.
// 4) If the change in any node temperature was greater-than0.01
// 5) Display the temperatures of the plane (steady-stateconditions)
// 6) Display the temperature at node (4,4).
//
// The program utilizes a user-defined library (plate.h &plate.cpp) that
// contains the following user-defined functions:
//
// displayPlate() : Purpose.: Displays the current temperatureof
// the plate in a grid format.
// Input…: None
// Output..: None
//
// distributeHeat() : Purpose.: Performs one iteration of new
// temperature calculations for the
// plate.
// Input…: None
// Output..: Returns a boolean value. Returns
// true if the temperature change in
// all the nodes is less-than 0.01
// degrees. Otherwise, returns false.
//
// plateValue() : Purpose.: Determine the current temperature
// of one node of the plate given the
// node’s coordinates.
// Input…: The coordinates (column, row) of a
// node.
// Output..: Returns the temperature (double) of
// the node.
//

The program must have three files (Metal_Plate_Temp.cpp,plate.cpp & plate.h) and using three functions listed above. Itcan include more than 3 functions listed above.

Metal_Plate_Temp will be utilizing user-defined libraryplate.cpp and plate.h files. Plate.h will include the headerinformation that is needed for the program, while plate.cpp willinclude the three functions listed above. And it must be in C++language.

Problems Tasks ConsoleProperties Show transcribed image text

. . .

Coursehelp

## (Solved) : Code Review Review Code Metalplatetempcpp Attached Program Listing Information Required Un Q30757792 . . .

Code Review:

Review the code (Metal_Plate_Temp.cpp) in the attached programlisting. As it should be, all the information required tounderstand this program is included in the code comments. Below isa screen-shot for the program’s expected output.

Project Requirements:

Your objective for this coding problem is to implement the codefor main() along with the user defined function in plate.cpp &plate.cpp.

You must submit the FULLY DOCUMENTED source code for the threesource files (Metal_Plate_Temp.cpp, plate.cpp & plate.h).

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Name : Metal_Plate_Temp.cpp
// Author : Dr. George H. Zion
// Course : Computation Problem Solving II (CPET-321)
// Date : Fall 2018 (2181)
// Description :
//
// Under steady-state conditions, the temperature at any point onthe
// surface of a metal plate will be the average of the temperaturesof
// all the points surrounding it. This fact can be used in aniterative
// procedure to calculate the temperature distribution at allpoints on a
// plane.
//
// Figure #1 shows a square plate divided into 100 squares or nodesby a
// grid. The temperature of the nodes form two-dimensionalarray.
//
// 9 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 8 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 7 [ ][ ][X][ ][ ][ ][ ][ ][ ][ ]
// 6 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 5 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 4 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 3 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 2 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 1 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 1 2 3 4 5 6 7 8 9
//
// Figure #1
//
// The temperature at all nodes at the edges of the plate areconstrained
// to 20 degrees Celsius by a cooling system, and the temperatureat the
// node (2,7) is fixed at 100 degrees Celsius by exposure toboiling water.
//
// A new estimate of the temperature T(R,C) at any node can becalculated
// from the average of the temperatures of all nodes surrounding itusing
// the formula in Equation #1.
//
// T(R,C)new = 1/4 ([ T(R+1, C) + T(R-1), C) + T(R, C+1) + T(R,C-1)]
//
// Equation #1
//
// To determine the temperature distribution on the surface of aplate,
// then equation #1 is applied to calculate the new temperature atthe
// node. These updated temperatures are, in turn, used to calculatenew
// temperature. This process is repeated until all new temperaturesat
// each node reach a steady-state.
//
// This program calculates the steady-state temperaturedistribution
// throughout the plate, making an initial assumption that allinterior
// segments are at a temperature of 50 degrees Celsius (Rememberthat
// all outside segments are fixed at 20 degrees Celsius and thenode (2,7)
// is fixed at 100 degrees Celsius).
//
// The program follows the following algorithm/pseudo-code:
//
// 1) Display the temperatures of the plane (initialconditions).
// 2) Display an ‘*’ on the screen.
// 3) Perform one interation of new temperature calculations
// for the plate.
// 4) If the change in any node temperature was greater-than0.01
// 5) Display the temperatures of the plane (steady-stateconditions)
// 6) Display the temperature at node (4,4).
//
// The program utilizes a user-defined library (plate.h &plate.cpp) that
// contains the following user-defined functions:
//
// displayPlate() : Purpose.: Displays the current temperatureof
// the plate in a grid format.
// Input…: None
// Output..: None
//
// distributeHeat() : Purpose.: Performs one iteration of new
// temperature calculations for the
// plate.
// Input…: None
// Output..: Returns a boolean value. Returns
// true if the temperature change in
// all the nodes is less-than 0.01
// degrees. Otherwise, returns false.
//
// plateValue() : Purpose.: Determine the current temperature
// of one node of the plate given the
// node’s coordinates.
// Input…: The coordinates (column, row) of a
// node.
// Output..: Returns the temperature (double) of
// the node.
//

The program must have three files (Metal_Plate_Temp.cpp,plate.cpp & plate.h) and using three functions listed above. Itcan include more than 3 functions listed above.

Metal_Plate_Temp will be the top file that includes theplate.cpp and plate.h files. Plate.h will include the headerinformation that is needed for the program, while plate.cpp willinclude the three functions listed above. And it must be in C++language.

Problems Tasks ConsoleProperties Show transcribed image text

. . .

Coursehelp

## (Solved) : Code Review Review Code Metalplatetempcpp Attached Program Listing Information Required Un Q30757791 . . .

Code Review:

Review the code (Metal_Plate_Temp.cpp) in the attached programlisting. As it should be, all the information required tounderstand this program is included in the code comments. Below isa screen-shot for the program’s expected output.

Project Requirements:

Your objective for this coding problem is to implement the codefor main() along with the user defined function in plate.cpp &plate.cpp.

You must submit the FULLY DOCUMENTED source code for the threesource files (Metal_Plate_Temp.cpp, plate.cpp & plate.h).

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Name : Metal_Plate_Temp.cpp
// Author : Dr. George H. Zion
// Course : Computation Problem Solving II (CPET-321)
// Date : Fall 2018 (2181)
// Description :
//
// Under steady-state conditions, the temperature at any point onthe
// surface of a metal plate will be the average of the temperaturesof
// all the points surrounding it. This fact can be used in aniterative
// procedure to calculate the temperature distribution at allpoints on a
// plane.
//
// Figure #1 shows a square plate divided into 100 squares or nodesby a
// grid. The temperature of the nodes form two-dimensionalarray.
//
// 9 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 8 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 7 [ ][ ][X][ ][ ][ ][ ][ ][ ][ ]
// 6 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 5 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 4 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 3 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 2 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 1 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 1 2 3 4 5 6 7 8 9
//
// Figure #1
//
// The temperature at all nodes at the edges of the plate areconstrained
// to 20 degrees Celsius by a cooling system, and the temperatureat the
// node (2,7) is fixed at 100 degrees Celsius by exposure toboiling water.
//
// A new estimate of the temperature T(R,C) at any node can becalculated
// from the average of the temperatures of all nodes surrounding itusing
// the formula in Equation #1.
//
// T(R,C)new = 1/4 ([ T(R+1, C) + T(R-1), C) + T(R, C+1) + T(R,C-1)]
//
// Equation #1
//
// To determine the temperature distribution on the surface of aplate,
// then equation #1 is applied to calculate the new temperature atthe
// node. These updated temperatures are, in turn, used to calculatenew
// temperature. This process is repeated until all new temperaturesat
// each node reach a steady-state.
//
// This program calculates the steady-state temperaturedistribution
// throughout the plate, making an initial assumption that allinterior
// segments are at a temperature of 50 degrees Celsius (Rememberthat
// all outside segments are fixed at 20 degrees Celsius and thenode (2,7)
// is fixed at 100 degrees Celsius).
//
// The program follows the following algorithm/pseudo-code:
//
// 1) Display the temperatures of the plane (initialconditions).
// 2) Display an ‘*’ on the screen.
// 3) Perform one interation of new temperature calculations
// for the plate.
// 4) If the change in any node temperature was greater-than0.01
// 5) Display the temperatures of the plane (steady-stateconditions)
// 6) Display the temperature at node (4,4).
//
// The program utilizes a user-defined library (plate.h &plate.cpp) that
// contains the following user-defined functions:
//
// displayPlate() : Purpose.: Displays the current temperatureof
// the plate in a grid format.
// Input…: None
// Output..: None
//
// distributeHeat() : Purpose.: Performs one iteration of new
// temperature calculations for the
// plate.
// Input…: None
// Output..: Returns a boolean value. Returns
// true if the temperature change in
// all the nodes is less-than 0.01
// degrees. Otherwise, returns false.
//
// plateValue() : Purpose.: Determine the current temperature
// of one node of the plate given the
// node’s coordinates.
// Input…: The coordinates (column, row) of a
// node.
// Output..: Returns the temperature (double) of
// the node.
//

The program must have three files (Metal_Plate_Temp.cpp,plate.cpp & plate.h) and using three functions listed above. Itcan include more than 3 functions listed above.

Problems Tasks ConsoleProperties Show transcribed image text

. . .

Coursehelp

## (Solved) : Code Runs Ping Ping Reply Ttl Flooding Need Implement Neighbor Discovery Unsure Begin Incl Q31130351 . . .

This code runs ping, ping reply, TTL, and Flooding, i now needto implement Neighbor Discovery but am unsure how to begin.

#include

#include “includes/command.h”

#include “includes/packet.h”

#include “includes/CommandMsg.h”

#include “includes/sendInfo.h”

#include “includes/channels.h”

module Node{

uses interface Boot;

uses interface SplitControl as AMControl;

uses interface SimpleSend as Sender;

uses interface CommandHandler;

uses interface List as PackageList;

uses interface List as NeighborList;

}

implementation{

uint16_t sequenceCounter = 0;

pack sendPackage;

// Prototypes

void makePack(pack *Package, uint16_t src, uint16_t dest,uint16_t TTL, uint16_t Protocol, uint16_t seq, uint8_t *payload,uint8_t length);

bool compPack(pack *Package);

void shovePack(pack Package);

event void Boot.booted(){

call AMControl.start();

dbg(GENERAL_CHANNEL, “Bootedn”);

}

event void AMControl.startDone(error_t err){

if(err == SUCCESS){

}else{

//Retry until successful

call AMControl.start();

}

}

event void AMControl.stopDone(error_t err){}

if(len==sizeof(pack)){

//dbg(GENERAL_CHANNEL, “Im inn”);

if(compPack(myMsg) || (myMsg->TTL == 0)){

//DROP DA PACKAGE

}elseif(myMsg->protocol == 0 && myMsg->dest ==TOS_NODE_ID){ // PING

dbg(GENERAL_CHANNEL,”WOOHOO From %d! to %d!n”, myMsg->src, myMsg->dest);

sequenceCounter++;

shovePack(sendPackage);

}elseif(myMsg->protocol == 1 && myMsg->dest ==TOS_NODE_ID){ // PING REPLY

dbg(GENERAL_CHANNEL,”Recieved ping reply from Node: %d!n”, myMsg->src);

}else{

dbg(GENERAL_CHANNEL,”Received package from %d going to %d, TTL: %d, Rebroad…n”,myMsg->src, myMsg->dest, myMsg->TTL);

shovePack(sendPackage);

}

return msg;

}

dbg(GENERAL_CHANNEL, “Unknown Packet Type %dn”, len);

return msg;

}

dbg(GENERAL_CHANNEL, “PING EVENT!!! n”);

}

event void CommandHandler.printNeighbors(){}

bool compPack(pack *Pack){

uint16_t j =0;

uint16_t size =call PackageList.size();

pack finder; //temp package to compare to package list for similarities

for(j = 0; j< size; j++){

finder= call PackageList.get(j); //iterate through list and compare

if(finder.src== Pack->src && finder.seq == Pack->seq &&finder.dest == Pack->dest){

return TRUE; // found same package at a node

}

}

return FALSE; //did not find package doppleganger

}

void makePack(pack *Package, uint16_t src, uint16_t dest,uint16_t TTL, uint16_t protocol, uint16_t seq, uint8_t* payload,uint8_t length){

Package->src = src;

Package->dest = dest;

Package->TTL = TTL;

Package->seq = seq;

Package->protocol = protocol;

}

void shovePack(pack Package) {

if (callPackageList.isFull()) {

callPackageList.popfront();

}

callPackageList.pushback(Package);

}

}

. . .

Coursehelp

## (Solved) : Code Running Matlab Clear Clc T Input Enter Car Type Seadan Suv S Switch T M Input Enter M Q35161771 . . .

why my code is not running on MATLAB?

clear;clc

T= input( ‘Enter the car Type(Seadan or SUV):’,’s’);switch(T)

M= input( ‘ Enter milles: ‘);

D=input( ‘Enter numeber of days: ‘);

case ‘Sedan’

if D<=6

ifM<=D*80

Price=79*D;

else

price=79*D+((M-D*80)*0.69)

end

elseif D<=29

ifM<D*100

price=69*D;

else

price =69*D+(M-D*100)*0.59;

end

else

ifM<=D*120

price=59*D;

else

price=59*D+(M-D*120)*0.49;

end

end

case ‘SUV’

if D<=6

ifM<=D*80

Price=84*D;

else

price=84*D+((M-D*80)*0.74)

end

elseif D<=29

ifM<D*100

price=74*D;

else

price =74*D+(M-D*100)*0.64;

end

else

ifM<=D*120

price=64*D;

else

price=64*D+(M-D*120)*0.54;

end

end

fprintf( ‘The price for the rent is%0.2 f\$/n’,price);

end

clear;clc

T= input( ‘Enter the car Type(Seadan or SUV):’,’s’);switch(T)

M= input( ‘ Enter milles: ‘);

D=input( ‘Enter numeber of days: ‘);

case ‘Sedan’

if D<=6

ifM<=D*80

Price=79*D;

else

price=79*D+((M-D*80)*0.69)

end

elseif D<=29

ifM<D*100

price=69*D;

else

price =69*D+(M-D*100)*0.59;

end

else

ifM<=D*120

price=59*D;

else

price=59*D+(M-D*120)*0.49;

end

end

case ‘SUV’

if D<=6

ifM<=D*80

Price=84*D;

else

price=84*D+((M-D*80)*0.74)

end

elseif D<=29

ifM<D*100

price=74*D;

else

price =74*D+(M-D*100)*0.64;

end

else

ifM<=D*120

price=64*D;

else

price=64*D+(M-D*120)*0.54;

end

end

fprintf( ‘The price for the rent is%0.2 f\$/n’,price);

end

. . .

Coursehelp

## (Solved) : Code Rstudio X Seq 4 4 Length 50 Y Q26236650 . . .

This is my code in RStudio:

x=seq(from=-4,to=4,length.out=50)
y <- dt(x, df = 19)
plot(x, y,type=”l”)

How can I shade the region under the curve that I have createdwith the above code from -4 to -2 and from 2 to 4? How can I dothat in RStudio?

. . .

Coursehelp

## (Solved) : Code Rk4 Following Need Help Please Provide Step Step Solution Use Malab Code Along Detail Q28150345 . . .

The code for rk4 is following :

Need help!! Please provide a step-by-step solution through theuse of MALAB code along with a detailed explanation!!!! It isalright if you handwrite the step-by-step solution but I wouldprefer the solution to be shown in MATLAB code. This is veryURGENT!!! PLEASE reply as soon as possible!! Thank you!!

Problem 1. Compute the solution to the systems for the given initial conditions using rk4.m. Plot your results in the phase plane (that is, y(t) vs. (t 1. Using initial conditions with (0)2 + y(0)2 both smaller and larger than 1 (inside and outside the unit circle), solve z'(t) =-4y + x(1-r2-y2), y'(t)-4x + y(1-x2-y2), over the interval 0Show transcribed image text

. . .

Coursehelp

## (Solved) : Code Review Review Code Metalplatetempcpp Attached Program Listing Information Required Un Q30758635 . . .

Code Review:

Review the code (Metal_Plate_Temp.cpp) in the attached programlisting. As it should be, all the information required tounderstand this program is included in the code comments. Below isa screen-shot for the program’s expected output.

Project Requirements:

Your objective for this coding problem is to implement the codefor main() along with the user defined function in plate.cpp &plate.cpp.

You must submit the FULLY DOCUMENTED source code for the threesource files (Metal_Plate_Temp.cpp, plate.cpp & plate.h).

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Name : Metal_Plate_Temp.cpp
// Author : Dr. George H. Zion
// Course : Computation Problem Solving II (CPET-321)
// Date : Fall 2018 (2181)
// Description :
//
// Under steady-state conditions, the temperature at any point onthe
// surface of a metal plate will be the average of the temperaturesof
// all the points surrounding it. This fact can be used in aniterative
// procedure to calculate the temperature distribution at allpoints on a
// plane.
//
// Figure #1 shows a square plate divided into 100 squares or nodesby a
// grid. The temperature of the nodes form two-dimensionalarray.
//
// 9 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 8 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 7 [ ][ ][X][ ][ ][ ][ ][ ][ ][ ]
// 6 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 5 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 4 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 3 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 2 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 1 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 [ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
// 0 1 2 3 4 5 6 7 8 9
//
// Figure #1
//
// The temperature at all nodes at the edges of the plate areconstrained
// to 20 degrees Celsius by a cooling system, and the temperatureat the
// node (2,7) is fixed at 100 degrees Celsius by exposure toboiling water.
//
// A new estimate of the temperature T(R,C) at any node can becalculated
// from the average of the temperatures of all nodes surrounding itusing
// the formula in Equation #1.
//
// T(R,C)new = 1/4 ([ T(R+1, C) + T(R-1), C) + T(R, C+1) + T(R,C-1)]
//
// Equation #1
//
// To determine the temperature distribution on the surface of aplate,
// then equation #1 is applied to calculate the new temperature atthe
// node. These updated temperatures are, in turn, used to calculatenew
// temperature. This process is repeated until all new temperaturesat
// each node reach a steady-state.
//
// This program calculates the steady-state temperaturedistribution
// throughout the plate, making an initial assumption that allinterior
// segments are at a temperature of 50 degrees Celsius (Rememberthat
// all outside segments are fixed at 20 degrees Celsius and thenode (2,7)
// is fixed at 100 degrees Celsius).
//
// The program follows the following algorithm/pseudo-code:
//
// 1) Display the temperatures of the plane (initialconditions).
// 2) Display an ‘*’ on the screen.
// 3) Perform one interation of new temperature calculations
// for the plate.
// 4) If the change in any node temperature was greater-than0.01
// 5) Display the temperatures of the plane (steady-stateconditions)
// 6) Display the temperature at node (4,4).
//
// The program utilizes a user-defined library (plate.h &plate.cpp) that
// contains the following user-defined functions:
//
// displayPlate() : Purpose.: Displays the current temperatureof
// the plate in a grid format.
// Input…: None
// Output..: None
//
// distributeHeat() : Purpose.: Performs one iteration of new
// temperature calculations for the
// plate.
// Input…: None
// Output..: Returns a boolean value. Returns
// true if the temperature change in
// all the nodes is less-than 0.01
// degrees. Otherwise, returns false.
//
// plateValue() : Purpose.: Determine the current temperature
// of one node of the plate given the
// node’s coordinates.
// Input…: The coordinates (column, row) of a
// node.
// Output..: Returns the temperature (double) of
// the node.
//

The program must have three files (Metal_Plate_Temp.cpp,plate.cpp & plate.h) and using three functions listed above. Itcan include more than 3 functions listed above.

Metal_Plate_Temp will be utilizing user-defined libraryplate.cpp and plate.h files. Plate.h will include the headerinformation that is needed for the program, while plate.cpp willinclude the three functions listed above. And it must be in C++language.

. . .

Coursehelp

## (Solved) : Code Searching Txt File Displaying Information Correctly Found Show Wrong Code Show Code O Q32043497 . . .

I have this code but it is not searching the .txt file anddisplaying the information correctly when found. Can you show mewhat is wrong with this code. Can you show your code and output.You can use your own .txt file.

#include

#include

#include

using namespace std;

string fname[25];

string lname[30];

string email[25];

char filename[60];

};

public:

void display();

void displayall(){

for(int i =0; i<1; i++){

cout<<“First name:”<

cout<<“Last name:”<

cout<<“email:”<

}

}

ifstream infile;

//open the below file

infile.open (“MyList.txt”);

int counter=0;

if (infile.is_open()){ //if file opened

while( getline(infile, line,’n’) ) { //get row from textfile

cout <

string firstName,lastName;

stringstream ss(line); //stream to other variable

ss>>fname[counter]>>lname[counter]>>email[counter];

counter++;

}

infile.close(); //close file

cout<

cout<<“File scan done……..”<< endl;

}

cout << “Sorry, we could not find the file.” <<endl;

}

}

ifstream infile ;

// Function to perform search based on first name

void searchbyFirstName(string first_name){

// Function to perform search based on first name

for(int i =0; i<1; i++){

if(first_name ==fname[i]){

cout<<“**Found The following with matching first name**n”;

cout<<“First name:”<

}

else{

}

}

}

// Function to perform search based on first name

void searchbyastName(string lastname){

// Function to perform search based on first name

for(int i =0; i<1; i++){

if(lastname ==lname[i]){

cout<<“**Found The following details with matching lastname** n”;

cout<<“First name:”<

cout <<“displayall”<

}

else{

}

}

}

// Function to perform search based on first name

void searchByNumber(int number){

number = number-1; // get actual array index

// Check for row number validity

if(number<= 1 && number >0){

cout<<“**Found The following details ** n”;

cout<<“First name:”<

cout<<“Last name:”<

cout<<“email:”<

}

else{

cout<<“Invalid number”;

}

}

};

int main (){

char repeat=’Y’/’N’;

string y;

string input;

string occurrences;

char word;

int done=0;

string fname,lname;

string search;

string enter;

string line;

string str[500];

int number;

do{

cout << “Please pick one of the following Choices”<< endl;

cout << “1)” << ” Displlayall ” << endl;

cout << “2)” << “search fnamer” << endl;

cout << “3)” << “search lname ” << endl;

cout << “4)” << “search number” << endl;

cout << “5)” << “water ” << endl;

cout <<“end”<

case 1:

cout << “displayall”<< endl;

// call the displayall function

break;

case 2:

cout << “Search by first name” << endl;

cin >> enter;

getline(cin,fname);

// call the searchByFirstName function

break;

case 3:

cout << “Search by last name” << endl;

cin >> enter;

// This call function will search by userLastName

break;

default:

cout <<“not valid”<< endl;

getline(cin,enter);

}

//calculator stuff, better to be in a separate function

cout << “nDo you want to continue (Y/N)?n”;

cout << “You must type a ‘Y’ or an ‘N’ :”

cin >> repeat;

for(int i =0; i<1; ++i){

cout <<“display “<

}

}

while ((repeat == ‘Y’) || (repeat == ‘y’));

return 0;

}

. . .

Coursehelp

## (Solved) : Code Script File Outdoordbv4sql Drop Table Orderdetails Drop Table Productorder Drop Table Q35339021 . . .

Here is the code for the script file outdoorDB_v4.sql

drop table order_details;
drop table product_order;
drop table club_membership;
drop table purchase_order;
drop table product;
drop table customer;
drop table club_activity;
drop table sporting_clubs;
drop table supplier;

drop sequence club_sequence;
drop sequence product_id_sequence;
drop sequence customer_sequence;
drop sequence membership_sequence;
drop sequence product_order_sequence;
drop sequence supplier_sequence;
drop sequence po_sequence;

create table sporting_clubs
(club_id number(3)constraint sporting_clubs_pk primary key,
name varchar2(30),
street varchar2(30),
city varchar2(15),
state char(2),
zip number(5),
phone varchar2(10));

create table club_activity
(club_id number(3)constraint club_activity_fk referencessporting_clubs,
activity varchar2(15),
constraint club_activity_pk primary key (club_id,activity));

create table supplier
(supplier_id varchar2(4) constraint supplier_pk primary key,
name varchar2(30),
street varchar2(30),
city varchar2(15),
state char(2),
zip number(5),
phone varchar2(10));

create table product
(product_id number(5) constraint product_pk primary key,
product_name varchar2(30),
quantity_in_stock number(3),
reorder_point number(2),
price number(5,2),
supplier_id varchar2(4) constraint product_fk referencessupplier,
reorder_qty number(2));

create table purchase_order
(po_no varchar2(4) constraint purchase_order_pk primary key,
po_date date,
product_id number(5) constraint purchase_order_fk1 referencesproduct,
quantity number(3),
supplier_id varchar2(4) constraint purchase_order_fk2 referencessupplier);

create table customer
(customer_id number(3) constraint customer_pk primary key,
first_name varchar2(10),
last_name varchar2(10),
street varchar2(30),
city varchar2(15),
state char(2)default ‘MO’,
zip number(5),
phone varchar2(10));

create table club_membership
(membership_id number(5) constraint club_membership_pk primarykey,
membership_date date,
duration number(2),
amount number(4),
payment_type varchar2(5)constraint membership_payment_type_ck check((payment_type = ‘CC’) or (payment_type = ‘Check’)),
club_id number(3) constraint club_membership_fk1 referencessporting_clubs,
customer_id number(3) constraint club_membership_fk2 referencescustomer);

create table product_order
(order_id number(4) constraint product_order_pk primary key,
order_date date,
ship_date date,
payment_type varchar2(5)constraint prod_order_payment_type_ck check((payment_type = ‘CC’) or (payment_type = ‘Check’)),
total number (6,2),
customer_id number(3) constraint product_order_fk1 referencescustomer);

create table order_details
(order_id number(4),
product_id number(5),
quantity number(2),
constraint order_details_pk primary key(order_id,product_id),
constraint order_details_fk1 foreign key (order_id) referencesproduct_order,
constraint order_details_fk2 foreign key (product_id) referencesproduct);

create sequence club_sequence
increment by 10
nocache;

insert into sporting_clubs
values(club_sequence.nextval, ‘Hillside Mountain Club’, ‘1 WinonaSt’,’Wichita’,’KS’,34342,’3163997676′);
insert into sporting_clubs
values(club_sequence.nextval, ‘Branson Climbing Club’, ‘2 SherwoodDr.’,’Branson’,’MO’,65670,’4174485676′);
insert into sporting_clubs
values(club_sequence.nextval, ‘Cherokee Rafting Club’, ’44 KentAve.’,’St. Charles’,’MO’,66572,’3147780870′);
insert into sporting_clubs
values(club_sequence.nextval, ‘White Plains Club’, ‘225 TracySt.’,’New York’,’NY’,13567,’2126678090′);

insert into club_activity
values(100,’Hiking’);
insert into club_activity
values(100,’Climbing’);
insert into club_activity
values(100,’Walking’);
insert into club_activity
values(110,’Hiking’);
insert into club_activity
values(110,’Climbing’);
insert into club_activity
values(110,’Conservation’);
insert into club_activity
values(110,’Walking’);
insert into club_activity
values(120,’Conservation’);
insert into club_activity
values(120,’Canoeing’);
insert into club_activity
values(130,’Conservation’);
insert into club_activity
values(130,’Canoeing’);
insert into club_activity
values(130,’Walking’);

create sequence supplier_sequence
increment by 10
nocache;

insert into supplier
values(‘S’||supplier_sequence.nextval,’Hillside Ski’,’2717 S.Western Ave.’,’Los Angeles’,’CA’,90006,’7146654959′);
insert into supplier
values(‘S’||supplier_sequence.nextval,’Tiger Mountain’,’2600 S.Vermont Ave.’,’Los Angeles’,’CA’,90006,’7143327878′);
insert into supplier
values(‘S’||supplier_sequence.nextval,’Asha Outdoor’,’44 S. LaSalleSt.’,’Chicago’,’IL’,60603,’3125554678′);
insert into supplier
values(‘S’||supplier_sequence.nextval,’Sheraton Recreation’,’225Tracy St.’,’New York’,’NY’,13567,’2128889569′);

create sequence product_id_sequence
increment by 1
nocache;

insert into product
values(product_id_sequence.nextval,’Beginner”s SkiBoot’,20,5,9.75,’S500′,25);
insert into product
values(product_id_sequence.nextval,’Intermediate SkiBoot’,18,5,12.99,’S500′,20);
insert into product
values(product_id_sequence.nextval,’Pro SkiBoot’,21,7,15.49,’S510′,25);
insert into product
values(product_id_sequence.nextval,’Beginner”s SkiPole’,15,3,25.49,’S500′,20);
insert into product
values(product_id_sequence.nextval,’Intermediate SkiPole’,20,3,29.99,’S520′,22);
insert into product
values(product_id_sequence.nextval,’Pro SkiPole’,21,5,34.99,’S530′,25);
insert into product
insert into product
values(product_id_sequence.nextval,’MountainBicycle’,19,4,49.99,’S520′,20);
insert into product
values(product_id_sequence.nextval,’TirePump’,8,2,7.99,’S530′,10);
insert into product
values(product_id_sequence.nextval,’WaterBottle’,25,4,2.49,’S510′,25);
insert into product
values(product_id_sequence.nextval,’BicycleTires’,30,5,4.99,’S500′,33);
insert into product
values(product_id_sequence.nextval,’BicycleHelmet’,23,6,10.95,’S510′,25);

create sequence po_sequence
nocache;

insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘5/25/08′,’mm/dd/yy’),10011,20,’S500′);
insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘5/12/08′,’mm/dd/yy’),10015,25,’S530′);
insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘6/25/08′,’mm/dd/yy’),10011,20,’S500′);
insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘6/15/08′,’mm/dd/yy’),10018,10,’S530′);
insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘7/10/08′,’mm/dd/yy’),10015,25,’S530′);
insert into purchase_order
values(‘PO’||po_sequence.nextval,to_date(‘7/25/08′,’mm/dd/yy’),10019,25,’S510′);

create sequence customer_sequence
nocache;

insert into customer
insert into customer
values(customer_sequence.nextval,’Betty’,’Trumbell’,’550 SouthCourt Dr.’,’St. Louis’,’MO’,63140,’3125556670′);
insert into customer
values(customer_sequence.nextval,’Anil’,’Kaul’,’400 South CircleSt.’,’Kansas City’,’MO’,64530,’4316667070′);
insert into customer
values(customer_sequence.nextval,’Tom’,’Wiley’,’1500 North GrandSt.’,’Springfield’,’MO’,65810,’4178825560′);
insert into customer
values(customer_sequence.nextval,’Sharon’,’Stone’,’200 West WagnerSt.’,’Springfield’,’MO’,65807,’4176668890′);

create sequence membership_sequence
increment by 10
nocache;

insert into club_membership
values(membership_sequence.nextval,to_date(‘6/12/08′,’mm/dd/yy’),4,200,’CC’,100,101);
insert into club_membership
values(membership_sequence.nextval,to_date(‘6/15/08′,’mm/dd/yy’),2,100,’Check’,110,102);
insert into club_membership
values(membership_sequence.nextval,to_date(‘6/21/08′,’mm/dd/yy’),5,250,’Check’,120,103);

create sequence product_order_sequence
nocache;

insert into product_order
values(product_order_sequence.nextval,to_date(‘5/27/08′,’mm/dd/yy’),to_date(‘6/1/08′,’mm/dd/yy’),’CC’,134.95,102);
insert into product_order
values(product_order_sequence.nextval,to_date(‘5/28/08′,’mm/dd/yy’),to_date(‘6/2/08′,’mm/dd/yy’),’CC’,134.85,103);
insert into product_order
values(product_order_sequence.nextval,to_date(‘5/28/08′,’mm/dd/yy’),to_date(‘6/3/08′,’mm/dd/yy’),’Check’,12.45,104);
insert into product_order
values(product_order_sequence.nextval,to_date(‘6/5/08′,’mm/dd/yy’),to_date(‘6/10/08′,’mm/dd/yy’),’CC’,44.43,105);
insert into product_order
values(product_order_sequence.nextval,to_date(‘6/6/08′,’mm/dd/yy’),to_date(‘6/8/08′,’mm/dd/yy’),’Check’,52.48,103);
insert into product_order
values(product_order_sequence.nextval,to_date(‘6/8/08′,’mm/dd/yy’),to_date(‘6/12/08′,’mm/dd/yy’),’CC’,131.94,104);

insert into order_details values(1001,10011,2);
insert into order_details values(1001,10015,3);
insert into order_details values(1002,10011,5);
insert into order_details values(1002,10016,2);
insert into order_details values(1003,10019,5);
insert into order_details values(1004,10018,3);
insert into order_details values(1004,10011,1);
insert into order_details values(1004,10019,3);
insert into order_details values(1005,10017,1);
insert into order_details values(1005,10019,1);
insert into order_details values(1005,10021,1);
insert into order_details values(1006,10012,4);
insert into order_details values(1006,10015,2);

commit;

Ex5B-5. Utilize the Outdoor Clubs & Product database to add an attribute “qty ordered” to the product table with data type number(2), Now, create a procedure “ex5b add quantities” that adds the quantities that have been ordered for each product so far, and updates those values for the qty ordered attribute in the product table. For those products that do not yet have an order, the value inserted for the attribute should be zero. Atthe end of processing display the product_ id, qty_ordered values. Save the procedure source as a script file. Ex5B-8. Utilize the Outdoor Clubs & Product database to create a procedure”ex5b_supplier_update that contains two input parameters. The first input parameter is a supplier id attribute value that is used to delete the supplier from the supplier table. The second input parameter is also another supplier id attribute value that is used to update the deleted supplier entry (of the first input parameter) in the product and purchase order table with a new supplier value. Create a boolean function “ex5b supplier exist” to determine if the two input parameter supplier id attribute values exists before proceeding wth the data manipulations. If the suppliers do not exist, then display a message Invalid Suppliers. Run program unit again! Show transcribed image text