Answer:
double decimal1, decimal2;
int whole;
Explanation:
Required
Declare 2 decimals and 1 int.
The syntax to declare a variable is:
data-type variable-name;
To declare decimal, we simply make use of double or float data types.
So, we have:
double decimal1, decimal2; ----> for the decimal variables
And
int whole; ---- for the whole number
hub stake should always be provided with a lath stake so that the information about what the hub represents can be written on the lath stake True False
Answer:
True
Explanation:
To protect them from becoming disturbed by construction operations, hub stakes are placed on both sides of a roadway at a certain distance outside the work zone. The final stakes are connected to the hub stakes, which are used to write the essential information.
As a result, hub stakes are always accompanied with stakes.
Resize vector countDown to have newSize elements. Populate the vector with integers {newSize, newSize - 1, ..., 1}. Ex: If newSize = 3, then countDown = {3, 2, 1}, and the sample program outputs:
#include
#include
using namespace std;
int main() {
vector countDown(0);
int newSize = 0;
int i = 0;
newSize = 3;
STUDENT CODE
for (i = 0; i < newSize; ++i) {
cout << countDown.at(i) << " ";
}
cout << "Go!" << endl;
return 0;
}
Answer:
Following are the code to the given question:
#include <iostream>//defining header file
#include <vector>//defining header file
#include <numeric>//defining header file
using namespace std;
int main()//main method
{
vector<int> countDown(0);//defing an integer array variable countDown
int newSize = 0;//defing an integer variable newSize that holds a value 0
int i = 0;//defing an integer variable i that initialize with 0
newSize = 3;// //use newSize to hold a value
countDown.resize(newSize,0);// calling the resize method that accepts two parameters
for (i = 0; i < newSize; ++i)//defining a loop that reverse the integer value
{
countDown[i] = newSize -i;//reverse the value and store it into countDown array
cout << countDown.at(i) << " ";//print reverse array value
}
cout << "Go!" << endl;//print message
return 0;
}
Output:
3 2 1 Go!
Explanation:
In the given code inside the main method an integer array "countDown" and two integer variables "newSize and i" is declared that initializes a value that is 0.
In the next step, an array is used that calls the resize method that accepts two parameters, and define a for a loop.
In this loop, the array is used to reverse the value and print its value with the message.
Write a java program that reads a list of integers and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one. Assume that the list will always contain fewer than 20 integers.
Ex: If the input is:
5 2 4 6 8 10
the output is:
10,8,6,4,2,
To achieve the above, first read the integers into an array. Then output the array in reverse.
Answer:
Explanation:
using namespace std;
#include <iostream>
int Go()
{
int N;
int A[20];
cout << " How many integers do you have ??? :>";
cin >> N;
if (N>20) { N=20; }
for (int iLoop=0; iLoop<N; iLoop++)
{
cout << "Input integer # " << (iLoop+1) << " :>";
cin >> A[iLoop];
}
for (int iLoop=N-1; iLoop>=0; iLoop--)
{
cout << A[iLoop] << " ";
}
cout << endl;
}
int main()
{
Go();
}
A Java program that reads a list of integers and outputs them in reverse is written as,
import java.util.Scanner;
public class ReverseList {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
// Read the number of integers
int numIntegers = scnr.nextInt();
// Create an array to store the integers
int[] integers = new int[numIntegers];
// Read the integers into the array
for (int i = 0; i < numIntegers; i++) {
integers[i] = scnr.nextInt();
}
// Output the integers in reverse order
for (int i = numIntegers - 1; i >= 0; i--) {
System.out.print(integers[i]);
// Add comma unless it's the last integer
if (i > 0) {
System.out.print(",");
}
}
System.out.println(); // Add a new line at the end
}
}
Given that,
Write a Java program that reads a list of integers and outputs those integers in reverse.
Here, The input begins with an integer indicating the number of integers that follow.
For coding simplicity, follow each output integer by a comma, including the last one.
So, A Java program that reads a list of integers and outputs them in reverse:
import java.util.Scanner;
public class ReverseList {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
// Read the number of integers
int numIntegers = scnr.nextInt();
// Create an array to store the integers
int[] integers = new int[numIntegers];
// Read the integers into the array
for (int i = 0; i < numIntegers; i++) {
integers[i] = scnr.nextInt();
}
// Output the integers in reverse order
for (int i = numIntegers - 1; i >= 0; i--) {
System.out.print(integers[i]);
// Add comma unless it's the last integer
if (i > 0) {
System.out.print(",");
}
}
System.out.println(); // Add a new line at the end
}
}
Read more about java programming language at:
brainly.com/question/2266606
#SPJ4
Write a class called Student that has two private data members - the student's name and grade. It should have an init method that takes two values and uses them to initialize the data members. It should have a get_grade method.
Answer:
Explanation:
The following class is written in Python as it is the language that uses the init method. The class contains all of the data members as requested as well as the init and get_grade method. It also contains a setter method for both data variables and a get_name method as well. The code can also be seen in the attached image below.
class Student:
_name = ""
_grade = ""
def __init__(self, name, grade):
self._name = name
self._grade = grade
def set_name(self, name):
self._name = name
def set_grade(self, grade):
self._grade = grade
def get_name(self):
return self._name
def get_grade(self):
return self._grade
Draw a Card. Write a program to simulate drawing a card. Your program will randomly select one card from a deck of 52 playing cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card. Here is a sample run of the program: in The card you picked is Jack of Heart The program should use at a minimum: sequence, selection, arrays, and random numbers.
Answer:
Explanation:
The following code is written in Java. It is a function that creates a Random object to generate random values, then uses those values to choose a random rank and suit using switch statements. It then saves the rank and suit into a String variable in the correct format and finally prints the card that was picked to the screen. The function was called 4 times in the main method and the output can be seen in the attached image below.
public static void randomCardGenerator() {
Random rand = new Random();
int rank = rand.nextInt(14)+1;
int suit = rand.nextInt(4)+1;
String chosenCard = "";
switch (rank) {
case 1: chosenCard += "Ace"; break;
case 2: chosenCard += "1"; break;
case 3: chosenCard += "2"; break;
case 4: chosenCard += "3"; break;
case 5: chosenCard += "4"; break;
case 6: chosenCard += "5"; break;
case 7: chosenCard += "6"; break;
case 8: chosenCard += "7"; break;
case 9: chosenCard += "8"; break;
case 10: chosenCard += "9"; break;
case 11: chosenCard += "10"; break;
case 12: chosenCard += "Jack"; break;
case 13: chosenCard += "Queen"; break;
case 14: chosenCard += "Kind"; break;
default: System.out.println("Wrong Value");
}
chosenCard += " of ";
switch (suit) {
case 1: chosenCard += "Clubs"; break;
case 2: chosenCard += "Diamonds"; break;
case 3: chosenCard += "Hearts"; break;
case 4: chosenCard += "Spades"; break;
default: System.out.println("Invalid Suit");
}
System.out.println(chosenCard);
}
What are the LinkedIn automation tools you are using?
Answer:
Well, for me I personally use LinkedCamap to drive more LinkedIn connections, hundreds of leads, sales, and conversions automatically.
Some other LinkedIn automation tools are;
ExpandiMeet AlfredPhantombusterWeConnectLinkedIn HelperHope this helps!
what is the meaning of compiler
Answer:
in computing it means a program that converts instructions into a machine-code or lower-level form so that they can be read and executed by a computer.
Write a recursive function that calculates the sum 11 22 33 ... nn, given an integer value of nin between 1 and 9. You can write a separate power function in this process and call that power function as needed:
Answer:
The function in Python is as follows:
def sumDig(n):
if n == 1:
return 11
else:
return n*11 + sumDig(n - 1)
Explanation:
This defines the function
def sumDig(n):
This represents the base case (where n = 1)
if n == 1:
The function returns 11, when it gets to the base case
return 11
For every other value of n (n > 1)
else:
This calculates the required sum recursively
return n*11 + sumDig(n - 1)
Computer data that is suitable for text
Answer:
Answer:Data Types. Computer systems work with different types of digital data. In the early days of computing, data consisted primarily of text and ...
How did the military in the early 1900s move resources?
engines.
In the early 1900s, military moved their resources to distant locations with the help of
Answer:
In the early 1900s, military moved their resources to distant locations with the help of trains, ships, and, to a lesser extent, horse-drawn wagons. This was so because at that time airplanes did not yet exist, capable of transporting inputs to any part of the world in a very short period of time. Therefore, inputs and resources were brought by sea and, if impossible, through land, using railways or highways.
An e-mail program allows?
A. users to access and view web pages on the internet.
B. geographically separated people to transfer audio and video.
C. real-time exchange of messages or files with another online user.
D. transmission of messages and files via a network such as the internet.
Answer:
C
Explanation:
Real time exchange of messages or files with another online user
Explain why interrupt times and dispatch delays must be limited to a hard real-time system?
Answer:
The important problem is explained in the next section of clarification.
Explanation:
The longer it is required for a computing device interrupt to have been performed when it is created, is determined as Interrupt latency.
The accompanying duties include interrupt transmission delay or latency are provided below:
Store the instructions now being executed.Detect the kind of interruption.Just save the present process status as well as activate an appropriate keep interrupting qualitative functions.The valid call to the function installApplication is
void main( )
{
// call the function installApplication
}
void installApplication(char appInitial, int appVersion)
{
// rest of function not important
}
Answer:
B. installApplication(‘A’, 1);
Explanation:
Given
The above code segment
Required
The correct call to installApplication
The function installApplication is declared as void, meaning that it is not expected to return anything.
Also, it receives a character and an integer argument.
So, the call to this function must include a character and an integer argument, in that order.
Option D is incorrect because both arguments are integer
Option C is incorrect because it passes no argument to the function.
Option A is incorrect because it receives an integer value from the function (and the function is not meant not to have a return value).
Option B is correct
how many copies of each static variable and each class variable are created when 10 instances of the same class are created
Answer:
Static variables are initialized only once
Explanation:
Only one copy of static variables are created when 10 objects are created of a class
A static variable is common to all instances of a class because it is a class level variable
Mối quan hệ giữa đối tượng và lớp
1. Lớp có trước, đối tượng có sau, đối tượng là thành phần của lớp
2. Lớp là tập hợp các đối tượng có cùng kiểu dữ liệu nhưng khác nhau về các phương thức
3. Đối tượng là thể hiện của lớp, một lớp có nhiều đối tượng cùng thành phần cấu trúc
4. Đối tượng đại diện cho lớp, mỗi lớp chỉ có một đối tượng
Answer:
please write in english i cannot understand
Explanation:
How would you type the word floor
Answer:
f l o o r
Explanation:
How can I pass the variable argument list passed to one function to another function.
Answer:
Explanation:
#include <stdarg.h>
main()
{
display("Hello", 4, 12, 13, 14, 44);
}
display(char *s,...)
{
va_list ptr;
va_start(ptr, s);
show(s,ptr);
}
show(char *t, va_list ptr1)
{
int a, n, i;
a=va_arg(ptr1, int);
for(i=0; i<a; i++)
{
n=va_arg(ptr1, int);
printf("\n%d", n);
}
}
Write a program that uses a stack to test input strings to determine whether they are palindromes. A palindrome is a sequence of characters that reads the same as the sequence in reverse; for example, noon.
Answer:
Here the code is given as follows,
Explanation:
def isPalindrome(x):
stack = []
#for strings with even length
if len(x)%2==0:
for i in range(0,len(x)):
if i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
#for strings with odd length
else:
for i in range(0,len(x)):
if i==int(len(x)/2):
continue
elif i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
def main():
while True:
string = input("Enter a string or Return to quit: ")
if string == "":
break
elif isPalindrome(string):
print("It's a palindrome")
else:
print("It's not a palindrome")
if __name__ == '__main__':
main()
Write a recursive method to form the sum of two positive integers a and b. Test your program by calling it from a main program that reads two integers from the keyboard and users your method to complete and print their sum, along with two numbers.
Answer:
see the code snippet below writing in Kotlin Language
Explanation:
fun main(args: Array<String>) {
sumOfNumbers()
}
fun sumOfNumbers(): Int{
var firstNum:Int
var secondNum:Int
println("Enter the value of first +ve Number")
firstNum= Integer.valueOf(readLine())
println("Enter the value of second +ve Number")
secondNum= Integer.valueOf(readLine())
var sum:Int= firstNum+secondNum
println("The sum of $firstNum and $secondNum is $sum")
return sum
}
Which statement describes data-sharing in a blockchain?
Answer:
wheres the statement
Explanation:
The computer that is used in scientific research is ........
Answer:
supercomputers are the computer that is used in scientific research.
Answer:
super computer is the right answer
Fill in multiple blanks for [x], [y], [z]. Consider a given TCP connection between host A and host B. Host B has received all from A all bytes up to and including byte number 2000. Suppose host A then sends three segments to host B back-to-back. The first, second and third segments contain 50, 600 and 100 bytes of user data respectively. In the first segment, the sequence number is 2001, the source port number is 80, and the destination port number is 12000. If the first segment, then third segment, then second segment arrive at host B in that order, consider the acknowledgment sent by B in response to receiving the third segment. What is the acknowledgement number [x], source port number [y] and destination port number [z] of that acknowledgement
9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is:
Answer:
Explanation:
The following code is written in Java. It asks the user to enter the amount of change needed. This is done as a double since we are dealing with coins and not full dollar values alone. It then makes the necessary calculations to calculate the number of each coin needed and outputs it back to the user. A test case has been provided in the picture below with a sample output.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
int dollars = 1;
double quarters = 0.25;
double dimes = 0.10;
double nickels = 0.05;
double pennies = 0.01;
Scanner in = new Scanner(System.in);
System.out.println("Enter Change Value: ");
double change = in.nextDouble();
int numDollars, numQuarters, numDimes, numNickels, numPennies;
double newChange;
numDollars = (int) (change / dollars);
newChange = change % dollars;
numQuarters = (int) (newChange / quarters);
newChange = newChange % quarters;
numDimes = (int) (newChange / dimes);
newChange = newChange % dimes;
numNickels = (int) (newChange / nickels);
newChange = newChange % nickels + 0.001;
numPennies = (int) (newChange / pennies);
newChange = newChange % pennies;
System.out.println("Minimum Num of Coins needed: ");
if (numDollars != 1) {
System.out.println(numDollars + " Dollars");
} else {
System.out.println(numDollars + " Dollar");
}
if (numQuarters != 1) {
System.out.println(numQuarters + " Quarters");
} else {
System.out.println(numQuarters + " Quarter");
}
if (numDimes != 1) {
System.out.println(numDimes + " Dimes");
} else {
System.out.println(numDimes + " Dime");
}
if (numNickels != 1) {
System.out.println(numNickels + " Nickels");
} else {
System.out.println(numNickels + " Nickel");
}
if (numPennies != 1) {
System.out.println(numPennies + " Pennies");
} else {
System.out.println(numPennies + " Penny");
}
}
}
The program is an illustration of conditional statements
Conditional statements are used to make decisions
The program in C++ where comments are used to explain each line is as follows
#include<iostream>
using namespace std;
int main() {
// This line declare all the variables
int amount, dollar, quarter, dime, nickel, penny;
// This prompts the user for input (i.e. the amount)
cout<<"Amount: ";
//This gets the amount from the user
cin>>amount;
// This checks if the amount is 0 or less
if(amount<=0) {
//This prints "No Change"
cout<<"No Change";
}
//If the amount is greater than 0
else {
// These convert the amount to various coins
dollar = amount/100;
amount = amount%100;
quarter = amount/25;
amount = amount%25;
dime = amount/10;
amount = amount%10;
nickel = amount/5;
penny = amount%5;
// The next lines print the coins
if(dollar>=1) {
if(dollar == 1) {
cout<<dollar<<" dollar\n"; }
else {
cout<<dollar<<" dollars\n"; }
}
if(quarter>=1) {
if(quarter== 1) {
cout<<quarter<<" quarter\n";
}
else {
cout<<quarter<<" quarters\n";
}
}
if(dime>=1) {
if(dime == 1) {
cout<<dime<<" dime\n";
}
else {
cout<<dime<<" dimes\n";
}
}
if(nickel>=1) {
if(nickel == 1) {
cout<<nickel<<" nickel\n";
}
else {
cout<<nickel<<" nickels\n";
}
}
if(penny>=1) {
if(penny == 1) {
cout<<penny<<" penny\n";
}
else {
cout<<penny<<" pennies\n";
}
}
}
return 0;
}
Read more about conditions at:
https://brainly.com/question/15683939
We have removed
A
balls from a box that contained
N
balls and then put
B
new balls into that box. How many balls does the box contain now?
Constraints
All values in input are integers.
Input
Input is given from Standard Input in the following format: n a b
Output
Print the answer as an integer.
There were [tex]N[/tex] balls but we took [tex]A[/tex] balls out, so there are now [tex]N-A[/tex] balls. We add [tex]B[/tex] balls and now we have [tex]N-A+B[/tex] balls.
The program that computes this (I will use python as language has not been specified is the following):
n, a, b = int(input()), int(input()), int(input())
print(f"There are {n-a+b} balls in the box")
# Hope this helps
Why is OS important in every data processing system?
Please Answer Fast!
Answer:
Functions of an operating system. An operating system provides three essential capabilities: It offers a UI through a CLI or GUI; it launches and manages the application execution; and it identifies and exposes system hardware resources to those applications -- typically, through a standardized API.
Explanation:
What is machine learning
Answer:
machine learning is the ability for computers to develop new skills and algorithms without specific instructions to do so.
Create a function called GetColors that will accept two parameters. These parameters can only be red, blue or yellow. Your function needs to analyze these two colors and determine the color mix. Make sure your function returns the color mix back to where it was called.
Answer:
Explanation:
The following code is written in Java. It creates a GetColors method that takes in the two parameter colors of either red, blue or yellow. It combines those colors and returns the mix of the two colors back to the user. A test case has been used in the main method and the output can be seen in the attached image below.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
System.out.println(GetColors("yellow", "red"));
}
public static String GetColors(String color1, String color2) {
if (color1 == "red") {
if (color2 == "blue") {return "purple";}
else if (color2 == "yellow") {return "orange";}
else {return "red";}
} else if (color1 == "blue") {
if (color2 == "red") {return "purple";}
else if (color2 == "yellow") {return "green";}
else {return "blue";}
} else if (color1 == "yellow") {
if (color2 == "red") {return "orange";}
else if (color2 == "blue") {return "green";}
else {return "yellow";}
} else {
return "Wrong Parameters";
}
}
}
Can you suggest a LinkedIn Helper (automation tool) alternative?
Answer:
Have you tried LinkedCamp alternative to LinkedIn Helper?
Well, LinkedCamp is a super-efficient cloud-based LinkedIn Automation Tool that empowers businesses and sales industries to drive more LinkedIn connections, hundreds of leads, sales, and conversions automatically.
Some other LinkedIn automation tools are:
Meet Alfred Phantombuster WeConnect ZoptoExpandiHope you find it useful.
Good luck!
A technician is configuring the static TCP/IP settings on a client computer.
Which of the following configurations are needed for internet communications?
a. DHCP server address
b. DNS server address
c. Default gateway address
d. WINS address
e. APIPA address
f. Alternate IP address
g. IP address including a subnet mask (IPv4) or subnet prefix length (IPv6)
Answer:
The answer is below
Explanation:
Considering the situation and the available options above, the following configurations are needed for internet communications:
B. DNS server address: this matches the domain name to the IP address of a website such that browsers can bring internet resources.
C. Default gateway address: this uses the internet protocol suites and serves as a router to other networks in the absence of other route specifications that could match the destination IP address of a packet.
G. IP address including a subnet mask (IPv4) or subnet prefix length (IPv6): this is used by the internet-connected device to receive messages.
????????????????????????? ???????????????
Answer:
sorry, I don't know what that is