import java.util.Scanner;
public class Assignment{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
String firstName, lastName;
System.out.print("Firstname: ");
firstName = input.nextLine();
System.out.print("Lastname: ");
lastName = input.nextLine();
String fullName = firstName +" "+lastName;
System.out.print(fullName);
}
}
Explanation:
I'll use the line numbers in the question to point at the corresponding instruction
import java.util.Scanner; -- The import statement (1)
public class Assignment{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in); -- Scanner object (2)
String firstName, lastName; -- Variable declarations
System.out.print("Firstname: "); Prompt to enter first name (3)
firstName = input.nextLine(); --- User input for firstName (4)
System.out.print("Lastname: "); Prompt to enter first name (5)
lastName = input.nextLine(); --- User input for lastName (6)
String fullName = firstName +" "+lastName; --- concatenating both user inputs (7)
System.out.print(fullName); --- Print out fullName (8)
}
}
import java.util.Scanner;
public class Assignment{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in);
String firstName, lastName;
System.out.print("Firstname: ");
firstName = input.nextLine();
System.out.print("Lastname: ");
lastName = input.nextLine();
String fullName = firstName +" "+lastName;
System.out.print(fullName);
}
}
Explanation:
I'll use the line numbers in the question to point at the corresponding instruction
import java.util.Scanner; -- The import statement (1)
public class Assignment{
public static void main(String [] args)
{
Scanner input = new Scanner(System.in); -- Scanner object (2)
String firstName, lastName; -- Variable declarations
System.out.print("Firstname: "); Prompt to enter first name (3)
firstName = input.nextLine(); --- User input for firstName (4)
System.out.print("Lastname: "); Prompt to enter first name (5)
lastName = input.nextLine(); --- User input for lastName (6)
String fullName = firstName +" "+lastName; --- concatenating both user inputs (7)
System.out.print(fullName); --- Print out fullName (8)
}
}
Provided in the section below
Explanation:
Using C# Code:
using System;
class Environment{
//temperature
private double temp;
//sets initial value of temp to 100 Fahrenheits
public Environment(){
temp=100;
}
//sets initial value to given temp
public Environment(double t) {
this.temp = t;
}
//returns temp
public double getTemp(){
return temp;
}
//calculates temp at given frequency
public void calcTemperature(double frequency){
temp=(frequency+40)/4.0;
}
}
class Cricket{
private Random r=new Random();
//frequency of birds
protected double frequency;
//sets frequency to a random value between 0-100
public Cricket(){
frequency=r.NextDouble()*100;
}
//sets frequency to a given frequency
public Cricket(double f) {
frequency = f;
}
//returns the frequency
public double getFrequency() {
return frequency;
}
//randomize the frequency
public virtual void randomFrequency() {
frequency = r.NextDouble()*100;
}
}
class ClemsonCricket: Cricket{
//sets the frequency to 80% of the parent's
public ClemsonCricket(): base(){
frequency=frequency*0.8;
}
//sets frequency to a given frequency
public ClemsonCricket(double f): base(f){}
//randomize frequency and sets it to 80% of the parent's
public override void randomFrequency(){
base.randomFrequency();
frequency=frequency*0.8;
}
}
public class testCrickets {
static void Main(){
Environment env=new Environment();
Console.WriteLine("Initial Temp: "+env.getTemp());
Cricket cricket=new Cricket();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
cricket.randomFrequency();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
Console.WriteLine("\nClemson Cricket: ");
ClemsonCricket clemsonCricket=new ClemsonCricket();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
clemsonCricket.randomFrequency();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}" ,env.getTemp()));
Console.WriteLine("\nPolymorphism Clemson Cricket: ");
Cricket Ccricket=new ClemsonCricket();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
Ccricket.randomFrequency();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
}
}
cheers i hope this helped !!
Provided in the section below
Explanation:
Using C# Code:
using System;
class Environment{
//temperature
private double temp;
//sets initial value of temp to 100 Fahrenheits
public Environment(){
temp=100;
}
//sets initial value to given temp
public Environment(double t) {
this.temp = t;
}
//returns temp
public double getTemp(){
return temp;
}
//calculates temp at given frequency
public void calcTemperature(double frequency){
temp=(frequency+40)/4.0;
}
}
class Cricket{
private Random r=new Random();
//frequency of birds
protected double frequency;
//sets frequency to a random value between 0-100
public Cricket(){
frequency=r.NextDouble()*100;
}
//sets frequency to a given frequency
public Cricket(double f) {
frequency = f;
}
//returns the frequency
public double getFrequency() {
return frequency;
}
//randomize the frequency
public virtual void randomFrequency() {
frequency = r.NextDouble()*100;
}
}
class ClemsonCricket: Cricket{
//sets the frequency to 80% of the parent's
public ClemsonCricket(): base(){
frequency=frequency*0.8;
}
//sets frequency to a given frequency
public ClemsonCricket(double f): base(f){}
//randomize frequency and sets it to 80% of the parent's
public override void randomFrequency(){
base.randomFrequency();
frequency=frequency*0.8;
}
}
public class testCrickets {
static void Main(){
Environment env=new Environment();
Console.WriteLine("Initial Temp: "+env.getTemp());
Cricket cricket=new Cricket();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
cricket.randomFrequency();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
Console.WriteLine("\nClemson Cricket: ");
ClemsonCricket clemsonCricket=new ClemsonCricket();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
clemsonCricket.randomFrequency();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}" ,env.getTemp()));
Console.WriteLine("\nPolymorphism Clemson Cricket: ");
Cricket Ccricket=new ClemsonCricket();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
Ccricket.randomFrequency();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
}
}
cheers i hope this helped !!
The solution that would help the client pool their data together is a data integration solution. This type of solution allows for the collection and consolidation of data from various sources into a single, unified database. This can be achieved through a variety of methods, including Extract, Transform, Load (ETL) processes, data warehousing, and master data management. By implementing a data integration solution, the client will be able to access and analyze their data more efficiently, leading to better insights and informed decision-making.
The correct answer to the following question will be "Auto-encoder".
Explanation:
It is indeed a form of artificial neural net that utilizes in an unmonitored way to practice successful information coding.
The objective of such an auto-encoder seems to be to acquire a specification (encoding) for a collection of information, usually for reducing degrees of freedom, by teaching the channel to overlook the "noise" message.Learn a few things of endogenous model representation and then use it to recreate the object.A code in C++ follows:
Explanation:
#include<iostream>
using namespace std;
int calculate_area(int width, int length)
{
int area;
area=width*length;
return area;
}
int main()
{
int a,b,ar,c,d,ar1,n;
cout<<"\nEnter length of room:";
cin>>a;
cout<<"\nEnter width of room:";
cin>>b;
ar=calculate_area(a,b);
cout<<"\nArea of room:"<<ar<<" units";
cout<<"\nEnter length of mat:";
cin>>c;
cout<<"\nEnter width of mat:";
cin>>d;
ar1=calculate_area(c,d);
n=ar/ar1;
cout<<"\nNumber of mats required are:"<<n;
return 0;
}
def get_word(sentence, n):
# Only proceed if n is positive
if n > 0:
words = sentence.split()
# Only proceed if n is not more than the number of words
if n <= len(words):
return words[n-1]
return (" ")
print(get_word("This is a lesson about lists", 4)) # Should print: lesson
print(get_word("This is a lesson about lists", -4)) # Nothing
print(get_word("Now we are cooking!", 1)) # Should print: Now
print(get_word("Now we are cooking!", 5)) # Nothing
Explanation:
Added parts are highlighted.
If n is greater than 0, split the given sentence using split method and set it to the words.
If n is not more than the number of words, return the (n-1)th index of the words. Since the index starts at 0, (n-1)th index corresponds to the nth word
It will provide an instant answer!