Question: 8 Which of the following should be written in the following program in place of //WHAT GOES HERE? to show an alert that tells the user what their food and drink order was? export default class App extends Component { state = { foodOrder: 'burger' drinkorder: 'root beer' } render() { return ( Food Order this.setState({foodOrder})} value={this.state.foodOrder} /> Drink Order this.setState({drinkOrder})} value={this.state.drinkOrder} /> { alert( //WHAT GOES HERE? ) }}> Submit ); } } "You have ordered a ' + this.state.foodOrder +' and a + this.state.drinkOrder 'You have ordered a + {this.state.foodOrder} + and a + {this.state.drinkOrder} "You have ordered a ' + foodOrder + ' and a ' + drinkOrder "You have ordered a ’ + {foodOrder} + and a + {drinkOrder}

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter10: Classes And Data Abstraction
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

ill will be thankful for lifetime if u answer these simple two questions

i request you please help me with both questions please please

Question: 8
Which of the following should be written in the following program in place of //WHAT GOES HERE? to show an alert that tells the user what
their food and drink order was?
export default class App extends Component {
state = {
foodOrder: 'burger'
drinkorder: 'root beer'
}
render() {
return (
<View style={styles.container}>
<Text style={styles.title}>
Food Order
</Text>
<TextInput style={styles.textInput}
onChangeText={(foodOrder) => this.setState({foodOrder})}
value={this.state.foodOrder}
/>
<Text style={styles.title}>
Drink Order
</Text>
<TextInput style={styles.textInput}
onChangeText={(drinkOrder) => this.setState({drinkOrder})}
value={this.state.drinkOrder}
/>
<TouchableHighlight style={styles.button}
onPress={() => {
alert( //WHAT GOES HERE? )
}}>
<Text style={styles.buttonText}>
Submit
</Text>
</TouchableHighlight>
</View>
);
}
}
"You have ordered a ' + this.state.foodOrder +' and a
+ this.state.drinkOrder
'You have ordered a
+ {this.state.foodOrder} +
and a
+ {this.state.drinkOrder}
"You have ordered a '
+ foodOrder +
> and a '
+ drinkorder
"You have ordered a ’ + {foodOrder} +
and a
+ {drinkOrder}
Transcribed Image Text:Question: 8 Which of the following should be written in the following program in place of //WHAT GOES HERE? to show an alert that tells the user what their food and drink order was? export default class App extends Component { state = { foodOrder: 'burger' drinkorder: 'root beer' } render() { return ( <View style={styles.container}> <Text style={styles.title}> Food Order </Text> <TextInput style={styles.textInput} onChangeText={(foodOrder) => this.setState({foodOrder})} value={this.state.foodOrder} /> <Text style={styles.title}> Drink Order </Text> <TextInput style={styles.textInput} onChangeText={(drinkOrder) => this.setState({drinkOrder})} value={this.state.drinkOrder} /> <TouchableHighlight style={styles.button} onPress={() => { alert( //WHAT GOES HERE? ) }}> <Text style={styles.buttonText}> Submit </Text> </TouchableHighlight> </View> ); } } "You have ordered a ' + this.state.foodOrder +' and a + this.state.drinkOrder 'You have ordered a + {this.state.foodOrder} + and a + {this.state.drinkOrder} "You have ordered a ' + foodOrder + > and a ' + drinkorder "You have ordered a ’ + {foodOrder} + and a + {drinkOrder}
Question: 5
What will happen when the program below is run?
export default class App extends Component {
state = {
foodOrder: 'burger'
drinkorder: 'root beer'
}
render() {
return (
<View style={styles.container}>
<Text style={styles.title}>
Food Order
</Text>
<TextInput style={styles.textInput}
onChangeText={(food0rder) => this.setState({foodOrder})}
value={this.state.food0rder}
/>
<Text style={styles.title}>
Drink Order
</Text>
<TextInput style={styles.textInput}
onChangeText={(drinkOrder) => this.setState({drinkOrder})}
value={this.state.drinkOrder}
/>
</View>
);
}
Two text boxes will be shown on the screen. The box with the title 'Food Order' will
initially show 'burger' and the box with the title 'Drink Order' will initially show 'Root
Beer'.
The program will not run because there is an error.
Two text boxes will be shown on the screen. The box with the title 'Food Order' will
initially show 'foodOrder' and the box with the title 'Drink Order' will initially show
'drinkOrder'.
Two text boxes will be shown on the screen. Both text boxes will initially be blank.
Transcribed Image Text:Question: 5 What will happen when the program below is run? export default class App extends Component { state = { foodOrder: 'burger' drinkorder: 'root beer' } render() { return ( <View style={styles.container}> <Text style={styles.title}> Food Order </Text> <TextInput style={styles.textInput} onChangeText={(food0rder) => this.setState({foodOrder})} value={this.state.food0rder} /> <Text style={styles.title}> Drink Order </Text> <TextInput style={styles.textInput} onChangeText={(drinkOrder) => this.setState({drinkOrder})} value={this.state.drinkOrder} /> </View> ); } Two text boxes will be shown on the screen. The box with the title 'Food Order' will initially show 'burger' and the box with the title 'Drink Order' will initially show 'Root Beer'. The program will not run because there is an error. Two text boxes will be shown on the screen. The box with the title 'Food Order' will initially show 'foodOrder' and the box with the title 'Drink Order' will initially show 'drinkOrder'. Two text boxes will be shown on the screen. Both text boxes will initially be blank.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Research
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning